[SQLObject] how express a Inner Join consult with where and order ?
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: maram <mar...@gm...> - 2006-07-30 19:32:49
|
I Have a TurboGears-model: class Usuario(SQLObject): ruta = UnicodeCol(alternateID = True, length=10, notNone=True) nombre = UnicodeCol( length=50, default = '') lecturas = MultipleJoin("Lectura") class Lectura(SQLObject): periodo=UnicodeCol( length=6, notNone=True) consumo=IntCol(default=0) usuario = ForeignKey("Usuario", notNone=True) My specific problem is: "SELECT Lectura.periodo, Lectura.consumo, Usuario.ruta, Usuario.nombre FROM Lectura INNER JOIN Usuario ON Lectura.usuario_id=Usuario.usuario_id WHERE Lectura.periodo='200601' ORDER BY Usuario.ruta" Now, how do you express that in SQLObject? |