|
From: <mic...@ya...> - 2004-05-30 03:53:56
|
Hi againg guys!
I wondered with SQLObject :) It's cool...
I have tried out and had another 2 questions:
How is the best way to use SQLObject over a html schema? I using
webware and I think I can't pass the object throught requests, so I
must pass the id and get from Table the row matching the id.
I done something like this:
Table.select(Table.q.id==someid)
But is there a method like ByAlternateID? or is a easier way to do? The
list index is a choice: Table.select()[someid]?
Another question is in a join:
I have 2 tables:
class City:
name=StringCol(length=100)
state=ForeignKey('State')
class State:
name=StringCol(length=100)
cities=MultipleJoin('City')
I want to do something like:
select city.name from city inner join state on city.state_id=state.id
where city.name like '%somename%' and state.id=1;
I try:
[i for i in City.select((City.q.name.contains('something')) &
(State.q.id=1))]
with no sucess...
what can I do? I can select all cities from a specified state but I
couldn't choose the city matching the name...
thanks for all help!
=====
--
Michel Thadeu Sabchuk
Curitiba/PR
______________________________________________________________________
Participe da pesquisa global sobre o Yahoo! Mail:
http://br.surveys.yahoo.com/global_mail_survey_br
|