Le vendredi 15 janvier 2010 à 09:28 -0800, Nelson a écrit :
> Hello SQLAlchemy experts,
>
> I'd like to view the contents of a table object as a dictionary.
> Example:
>
> s = Table('sparrow', Column('type', String(50)) , Column('weight',
> Integer), ... etc)
> s.type = 'African'
> s.weight = 32
>
> Then I want to see / get a dictionary:
>
> {'type': 'African, weight: 32, ... etc}
>
> Easy way to do that I'm missing?
s.__dict__ ?
You'll have to filter out any private attributes set by SQLAlchemy.
--
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.