[sqlalchemy] Re: the columns retrieved in a recordset

2008-01-19 Thread sdobrev

theoreticaly, looking at the sql.expression.py/Select, try
   for a in yourselect.inner_columns: print a
it's a yielding property.

alex bodnaru wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 
 hi friends,
 
 could i know the columns a select would retrieve, without examining the
 first record retrieved?
 or if no records matched the where.
 
 tia ,
 
 alex

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: the columns retrieved in a recordset

2008-01-19 Thread alex bodnaru

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


thanks for your answer.

i just wonder whether the * (all columns) is being expanded there.

alex

[EMAIL PROTECTED] wrote:
 theoreticaly, looking at the sql.expression.py/Select, try
for a in yourselect.inner_columns: print a
 it's a yielding property.
 
 alex bodnaru wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1


 hi friends,

 could i know the columns a select would retrieve, without examining the
 first record retrieved?
 or if no records matched the where.

 tia ,

 alex
 
  
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBR5JfrNpwN1sq38njAQJ+gwQAqkvp2a2+9y6lq0tOfiGr6KcXAZ78NJi0
YzMdMgpgFC7kRHbqEydDg1OW8O1i+FvW75fMvFZm1bqi10A7faJEqx8TUrBJOOdw
97oGDshxUEWlB9XB2+k1c32TPlIgQaBYdNaOPUDTuulyUullIFPbv9aYUvYSlm4I
pRws955+d1U=
=Fw/H
-END PGP SIGNATURE-

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: the columns retrieved in a recordset

2008-01-19 Thread sdobrev

 i just wonder whether the * (all columns) is being expanded there.
try?

 [EMAIL PROTECTED] wrote:
 theoreticaly, looking at the sql.expression.py/Select, try
for a in yourselect.inner_columns: print a
 it's a yielding property.

 alex bodnaru wrote:
 could i know the columns a select would retrieve, without examining the
 first record retrieved?
 or if no records matched the where.

 tia ,

 alex


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: the columns retrieved in a recordset

2008-01-19 Thread Michael Bayer


On Jan 19, 2008, at 7:49 AM, alex bodnaru wrote:


 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1


 hi friends,

 could i know the columns a select would retrieve, without examining  
 the
 first record retrieved?
 or if no records matched the where.


result.keys()

this returns you string names.

if you have a select(), you can get the cols without even executing by  
saying someselect.c.keys(), or you can get the Column objects by  
saying list(someselect.c).



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: the columns retrieved in a recordset

2008-01-19 Thread Michael Bayer


On Jan 19, 2008, at 4:50 PM, Michael Bayer wrote:

 result.keys()

oh its a propresult.keys

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: the columns retrieved in a recordset

2008-01-19 Thread alex bodnaru

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

thanks a lot, mike and sdobrev :)

Michael Bayer wrote:
 
 On Jan 19, 2008, at 4:50 PM, Michael Bayer wrote:
 
 result.keys()
 
 oh its a propresult.keys
 
  
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBR5J6B9pwN1sq38njAQKjjAQAtPM6Og2DB1lnnAgi1eh50LVdcQmC2M+P
lIaj+GGYFwf2z4phVi09mVBiieZtGvZhe+XwcUbhG5iou6b7AqoIh/zUu1gza63D
MbWnI2DmdpBAU1WTiVGg9i8IEjxAObWRtmbb6dgIfv/sRd1N4/eqszX0F6/1QnW0
asdgKwQ3z6s=
=lbwT
-END PGP SIGNATURE-

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---