4 messages in com.googlegroups.sqlalchemy[sqlalchemy] Re: how to get column na...| From | Sent On | Attachments |
|---|---|---|
| vkuznet | 24 Feb 2007 12:29 | |
| Jonathan Ellis | 26 Feb 2007 09:50 | |
| King Simon-NFHD78 | 26 Feb 2007 10:02 | |
| vkuznet | 26 Feb 2007 12:33 |
| Subject: | [sqlalchemy] Re: how to get column names in result![]() |
|---|---|
| From: | King Simon-NFHD78 (simo...@motorola.com) |
| Date: | 02/26/2007 10:02:28 AM |
| List: | com.googlegroups.sqlalchemy |
Also, the rows that you get back from a 'select' are instances of RowProxy, so you can use row.keys() to get the names even after column labels have been applied.
http://www.sqlalchemy.org/docs/docstrings.myt#docstrings_sqlalchemy.engi ne_RowProxy
Simon
-----Original Message----- From: sqla...@googlegroups.com [mailto:sqla...@googlegroups.com] On Behalf Of Jonathan Ellis Sent: 26 February 2007 17:51 To: sqla...@googlegroups.com Subject: [sqlalchemy] Re: how to get column names in result
You can see what columns are part of a table (or a select!) with .columns.keys() or .c.keys().
On 2/24/07, vkuznet <vkuz...@gmail.com> wrote:
Hi, a very simple question which I cannot find in documentation. How to get column names together with result. This is useful for web presentation of results using templates. I used use_labels=True, indeed it construct query with names, but my final result contains only column values. What I wanted is to get as a first row the column names.
Thanks, Valentin.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqla...@googlegroups.com
To unsubscribe from this group, send email to
sqla...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---




