z3c.form: Problem with DictionaryField datamanger

Michael Howitz <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
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 · [email protected] · 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

_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.