Lee McFadden wrote:


On 12/28/06, jose <[EMAIL PROTECTED]> wrote:


I Lee,
I see this examples works only with table object.
Is there a way to use it with class mappers?


If you're using the class mappers I'm not quite sure why you'd need to
fiddle with the labels - you shouldn't even need to see the generated
SQL outside of the logging of the SQL statements.  Is there some error
you're coming across due to the automatically generated labels?

Lee


I think I'm yet a little bit confused about using table objects or class mappers...
I think I'm doing a fruit salade with both of them:

Here I'm using classes (Anagrafica and Azienda) and also table objects (tbl['table_name']) because I need label()...
this is a readonly query, should I use only table objects, in this context?
/
sql=select(
      [Anagrafica.c.id, tbl['azienda'].c.id.label('pk'),
       Anagrafica.c.nome,
       Anagrafica.c.indirizzo,
       tbl['comune'].c.nome.label('nome_comune'),
       Azienda.c.codice_aziendale],
       limit=limit,
       offset=offset,order_by=[sort], use_labels=True)
/

jo




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to