I need to "empty" an item (row). I thought to do this:
new = Item() # create a new empty object
new.id_ = old.id_ # copy certain other fields also
self.session.expunge(old)
self.session.add(new)
self.session.commit()
But it seems SA still tries to save it with an INSERT. (I thought the presence
of the PK was what determined that.)
Is there some way to "blank" a record and save it back with the same PK and a
few other select fields that need to be kept?
Thanks,
Michael
--
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.