Search the web
Sign In
New User? Sign Up
zope
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
[Zope-dev] z3c.form: data manager for PersistentDict/PersistentMappi   Message List  
Reply | Forward Message #184167 of 185485 |
Re: [Zope-dev] z3c.form: data manager for PersistentDict/PersistentMapping

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.

Regards,
Stephan
--
Entrepreneur and Software Geek
Google me. "Zope Stephan Richter"
_______________________________________________
Zope-Dev maillist - Zope-Dev@...
http://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )



Mon Jul 13, 2009 2:49 pm

srichter@...
Send Email Send Email

Forward
Message #184167 of 185485 |
Expand Messages Author Sort by Date

Hello, 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...
Michael Howitz
mh@...
Send Email
Jul 11, 2009
3:43 pm

Hi Michael ... I think this is the right solution because there are many places in zope which do not work if a PeristentDict or PeristentList is given instead...
Roger Ineichen
dev@...
Send Email
Jul 11, 2009
11:47 pm

... I think so, too, but I was not sure. ... This is another problem. z3c.form.datamanager.DictionaryField sets the value directly on the dict, so I'd like to...
Michael Howitz
mh@...
Send Email
Jul 13, 2009
11:03 am

... Replying to myself, as I saw on the z3c.form trunk that DictionaryField already allows providers of zope.interface.common.mapping.IMapping additionally to...
Michael Howitz
mh@...
Send Email
Jul 13, 2009
11:21 am

... 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 ...
Stephan Richter
srichter@...
Send Email
Jul 13, 2009
2:54 pm

... 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...
Michael Howitz
mh@...
Send Email
Jul 14, 2009
6:46 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help