Ben Bangert wrote:
> Are you sure you're doing the person.__dict__.update in paster
> shell and elsewhere? I'm surprised this would work, since
> SQLAlchemy tracks changes with its properties on your object,
> while directly updating the object dictionary looks prone to
> bypassing the way SQLAlchemy tracks object changes. Also note that
> the way Jonathon copied it avoided the __dict__ update.
>
> I'd highly suggest:
> for attrib, val in self.form_result.iteritems():
> setattr(person, attrib, val)
Note that we also added a `set()` method to `Entity` a while back,
which lets you do this:
person.set(name='Jon', state='Georgia')
You should be able to pass `**dict` to this method to perform the
updates to your instance, too.
--
Jonathan LaCour
http://cleverdevil.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SQLElixir" 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/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---