El lun, 31-07-2006 a las 12:19 +0100, Lee McFadden escribió:
> On 7/31/06, maram <[EMAIL PROTECTED]> wrote:
> >
> > ==== My specific problem is: ====
> >
> > "SELECT Usuario.nombre, Usuario.ruta, Lectura.periodo, Lectura.consumo,
> > 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?
> 
> The select statement you want to use should be similar to the
> following after you've created your 'clave' variable in your
> controller:
> 
> Usuario.select(AND(Lectura.q.usuarioID == Usuario.q.id,
> Lectura.q.periodo == clave), orderBy="ruta")


I need a list of "lectura" object then:

ls=list(Lectura.select(AND(Lectura.q.usuarioID == Usuario.q.id,
                Lectura.q.periodo == clave), orderBy='Usuario.ruta')   )

it's run ok.
Thanks...

> 
> That should give you the results you need in one select statement.
> 
> Two observations, if I may:
> 
> 'periodo' should really be a DateTimeCol if I understand correctly, or

'periodo' is a special code for a specific data... only the "year and
month"

sorry by my bad writing of the English!... 

> Regards,
> 
> Lee
> 


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to