Return more then One field from database SQLAlchemy

Posted by David Neudorfer on Stack Overflow See other posts from Stack Overflow or by David Neudorfer
Published on 2012-11-05T01:45:08Z Indexed on 2012/11/05 17:00 UTC
Read the original article Hit count: 159

Filed under:
|

This line:

used_emails = [row.email for row
           in db.execute(select([halo4.c.email], halo4.c.email!=''))]

Returns:

['[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]']

I use this to find a match:

if recipient in used_emails:

If it finds a match I need to pull another field (halo4.c.code) from the database in the same row. Any suggestions on how to do this?

© Stack Overflow or respective owner

Related posts about python

Related posts about sqlalchemy