[Grok-dev] Heads up: applyChanges in EditForms changed

Philipp von Weitershausen philipp at weitershausen.de
Thu Mar 15 14:29:15 EDT 2007

 From the log message:

- I renamed applyChanges to apply_changes to match our PEP8 fetish

- I Moved it to general Form base class so that it's available on all
   forms. It now takes the object it should operate on as the first
   argument. That way you can either do::

     newobj = MyModel(**data)

   in your AddForm action (if MyModel's constructor takes arguments) or
   you can do::

     newobj = MyModel()
     self.apply_changes(newobj, **data)

- I made it not modify the status (the status message is something
   that's specific to forms, it was also not translatable). Instead,
   return boolean values like the original applyChanges().

http://worldcookery.com -- Professional Zope documentation and training

More information about the Grok-dev mailing list