On 9/30/07, Kevin <[EMAIL PROTECTED]> wrote:
>
>
> I'm assuming your using sqlobject.
> There are several ways.
> 1. Check here:
> http://www.sqlobject.org/SQLObject.html#one-to-many-relationships
> Also read the whole page. It's a good intro.
> 2. Could also use sqlbuilder
> http://www.sqlobject.org/SQLBuilder.html
> 3. Use straight SQL
> result = table1._connection.queryAll("query_here")
>
> I've ended up using all three of those methods at one time or another.
Thank you very much.
I've other question. When I try to make 2 queries I get an error and I don't
understand how this works
e.g
Models:
class Client(SQLObject):
name = StringCol(length=100,alternateID=True)
address = StringCol(length=200)
email = StringCol(length=50)
contacts = MultipleJoin("Contact")
class Contact(SQLObject):
client = ForeignKey("Client")
name = StringCol()
Controllers:
@expose("json")
def listClients(self):
list = dict()
clients = Client.select()
for client in clients:
list[client.name] = dict(contacts = client.contacts)
return list
If I go to http://localhost:8080/listClients I got this error
assert not self._obsolete, "This transaction has already gone through
ROLLBACK; begin another transaction"
AssertionError: This transaction has already gone through ROLLBACK;
begin another transaction
any help?
thanks again
On Sep 30, 12:20 pm, "Santiago Videla" <[EMAIL PROTECTED]>
> wrote:
> > Hi,
> >
> > I'm new with TurboGears, and I want to know if there is any place to
> look
> > about the options to make queries with select()
> >
> > e.g.
> >
> > I'm trying to select fields from severals Tables and I can't find the
> way.
> >
> > something like this:
> >
> > SELECT table1.field1, table2.field2 FROM table1,table2 WHERE table1.id =
> > table2.table1_id
> >
> > thanks in advance
> >
> > --
> > Santiago Videlawww.revolucionesweb.com.ar
> >
> > Sigue la mata dando de que hablar siempre abajo y a la izquierda donde
> el
> > pensamiento que se hace corazón resplandece con la palabra sencilla y
> > humilde que [EMAIL PROTECTED] [EMAIL PROTECTED] somos.
>
>
> >
>
--
Santiago Videla
www.revolucionesweb.com.ar
Sigue la mata dando de que hablar siempre abajo y a la izquierda donde el
pensamiento que se hace corazón resplandece con la palabra sencilla y
humilde que [EMAIL PROTECTED] [EMAIL PROTECTED] somos.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---