On Jan 15, 11:15 am, Antoine Pitrou <[email protected]> wrote:
> 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.
>
> s.__dict__ ?
> You'll have to filter out any private attributes set by SQLAlchemy.

Thanks, that did work. Filtering out the private attributes is
unfortunate, but can be done of course...

Actually, what I'm really trying to do here is to use the ORM to
UPDATE this table, and am playing games to get around the this
confounding issue: If I create my above table a try to merge it into
an ORM session it will do a SELECT on that row. I don't want the
SELECT, I'm going to change every column of data. The merge has a
dont_load option, but that does not seem to work.

By doing the above what I was trying to do is build my table using the
above style code and then create a Update() object to execute in the
session, thus skipping the unnecessary SELECT. Getting the dict allows
me to pass that into update.values().

Perhaps I'm even farther off the mark than it seemed earlier?!

- Nelson
-- 
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