[Zope-dev] z3c.form: Problem with DictionaryField datamanger
Michael Howitz
mh at gocept.com
Sat Jul 10 13:56:28 EDT 2010
Hi Wichert,
In Revision r112225 (see [1]) you make sure that the DictionaryField data manager conforms to the interface by raising an exception in datamanager.get() when a requested key is not found in the underlying dictionary.
Although it is nice to conform to the interface, this changes breaks code in a project of mine: z3c.form.form.applyChanges uses datamanager.get() to check whether the value has changed. Before r112225 this call returned the field.missing_value when the requested key does not exist. Now it raises an AttributeError, so applyChanges cannot continue.
I'm not sure whether it was intended that now all keys must exist in the dictionary.
In r114527 I prepared a change on a branch which uses datamanager.query() get the old value for comparison which allows that keys can be missing again in the dictionary.
I'd like to merge this change (it breaks no tests) into the trunk. Any objections?
[1] .. http://svn.zope.org/?rev=112225&view=rev
[2] .. http://svn.zope.org/?view=rev&rev=114527
Yours sincerely,
--
Michael Howitz · mh at gocept.com · software developer
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
Zope and Plone consulting and development
More information about the Zope-Dev
mailing list