dir(instance) is preferable to __dict__.keys() - the latter will not give
you deferred attributes, unloaded collections, or the expired version of
each of those.  dir() respects descriptors basically.


Lukasz Szybalski wrote:
>
> Hello,
> Could somebody tell me how can I print the object data in my result
> set without knowing the column names?
>
> myresult=session.query(...).all()
>
> for i in myresult:
>  print ????????????????
>
>
> I need to debug some data and its hard to print the object keys and
> values (column names and its values) .
>
> i.keys() ?
> i.items()?  some dictionary like functions would be nice.
>
> sqlalchemy.__version__
> '0.5.0rc1'
>
>
> Thanks,
> Lucas
>
>
>
> --
> How to create python package?
> http://lucasmanual.com/mywiki/PythonPaste
> Bazaar and Launchpad
> http://lucasmanual.com/mywiki/Bazaar
>
> >
>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to