Hi

I'm trying to use the result of a SQL query from ORM object

Here is my query ( return the last_login information of users per
domains )

s=sa.select([model.users_table.c.domain_name.label('domain_name'),
 
sa.func.max(model.users_table.c.last_imap_login).label('last_imap_login'),
 
sa.func.max(model.users_table.c.last_pop3_login).label('last_pop3_login'),
               ],
group_by=[model.users_table.c.domain_name]).alias('domain')

and I want to use it that way

for d in per_domain:
  print d.domain_name, d.last_imap.login, d.last_pop3_login

I need the glue in between!
Can you help me ?

I already tried this way

class DomainStat(object):
    pass

domain=mapper(DomainStat, s)

but didn't find the exit

Thanks

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

Reply via email to