On Dec 10, 8:10 pm, aspineux <[EMAIL PROTECTED]> wrote:
> 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 ?

Doesn't simply "for d in s:" work? If the 2nd line is a problem, try
"print d[0], d[1], d[2]".

If not, it might be because it's not clear what you're trying to do.
Maybe the stuff at the following link will help?
http://www.sqlalchemy.org/docs/04/sqlexpression.html#sql_selecting

--
Ben Sizer


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