[Zope3-Users] z3c.forms: Datamanger that combines values of multiple widgets

Hermann Himmelbauer dusty at qwer.tk
Tue Jun 12 11:45:14 EDT 2007


Hi,
I've read the doctests of z3c.forms and have to say that the package is really 
impressive. Many things look a lot cleaner and more customizeable than 
formlib. Thanks!

However, what I don't know is how to read/write values of multiple widgets 
into one context attribute. A common example of this would be a date, which 
is represented by three TextWidgets (rendered as input fields) that hold the 
year, month and day, which is stored into one context attribute of type 
datetime.

What would be the best way to accomplish that?

The reverse seems to be possible, e.g. a datamanger that splits a widget value 
into chunks, which are then stored into seperate context attributes, e.g. via 
a datamanger like "context.user, context.host = 'asdf at email.com'.split('@')".

Best Regards,
Hermann

-- 
x1 at aon.at
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7


More information about the Zope3-users mailing list