Groups
Groups
Sign in
Groups
Groups
sqlalchemy
Conversations
About
Send feedback
Help
query with one attribute of table to list
183 views
Skip to first unread message
lestat
unread,
Mar 27, 2012, 11:27:04 AM
3/27/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sqlal...@googlegroups.com
If I want get list of id's of table I can get it with
z = db.session.query(MyTable.id).all()
but it return list like [(7), (13)],
but I want like [7, 13].
Now I do it with [x[0] for x in z]
Maybe is exists better solution?
Thanks
lestat
unread,
Apr 12, 2012, 4:03:27 AM
4/12/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sqlal...@googlegroups.com
Maybe in sqlalchemy add attribute like "flat=True" that return list with values (instead of tuples with values) ?
вторник, 27 марта 2012 г., 19:27:04 UTC+4 пользователь lestat написал:
Reply all
Reply to author
Forward
0 new messages