Am 13.07.2009 um 16:49 schrieb Stephan Richter:
> On Saturday 11 July 2009, Michael Howitz wrote:
>> z3c.form.datamanager.DictionaryField is a data manager which is
>> registered for fields on a dict. In its __init__ it checks whether  
>> the
>> data object is an instance of dict. So this data manager does neither
>> work for UserDict nor PersistentDict/PersistentMapping.
>> I'd like to change this but there are two possibilities and I'm not
>> sure which is the best one:
>> 1.) Add a subclasses of DictionaryField which is registered for
>> UserDict and which checks whether the data object is an instance of
>> UserDict.
>>     (PersistentDict and PersistentMapping are subclasses of  
>> UserDict.)
>> 2.) Register DictionaryField for
>> zope.interface.common.mapping.IMapping. This might have a problem as
>> neither UserDict nor PersistentDict/PersistentMapping seem to provide
>> this interface. (Why?)
> I looked at this recently and the reason is that for containers we  
> did not
> usually want the dictionary field data manager, because we usually  
> want the
> regular instance based one.
> I am okay to add PersistentDict and PersistentMapping to the list. I  
> am
> already feeling unsure about UserDict, because people might want the  
> instance
> version instead. It is better to register the adapter for the  
> specific cases of
> your application.

I'm fine with that, so I'm going to allow PersistentDict and  
PersistentMapping in the constructor of DictionaryField and I'll add  
an note why the adapter is only registered for dict and not for the  
other possible data storages.

Yours sincerely,
Michael Howitz · · software developer
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany · tel +49 345 1229889 8 · fax +49 345 1229889 1
Zope and Plone consulting and development

Zope-Dev maillist  -
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to