[Zope] Making pythonscript changes to formulator fields persistent

Gaute Amundsen gaute at div.org
Mon Apr 2 10:49:50 EDT 2007


Hi.

Trying to change various properties of a few hundred formulator fields 
programmatically.

For example assigning to field.values['required'] = False.
This seemed to work, but of course was not persisted, and disappeared 
gradualy. Quite magical to see :)

Tried to take a copy of values and "overwrite" values with the changed ones, 
to trigger the presistence machinery, but that is not allowed.
The same goes for  setting field._p_changed = True, and accessing 
field._edit().

I can use field.manage_edit() but then I have to masage all the data from 
field.values into "request format" to have it accepted, otherwise I get 
"required" errors, or values gets deleted.

What to do?

I guess some developer has worked hard to prevent me from doing just this at 
some point, but why? Do I need to write a product  to do it?
Is anyone at all using this crazy development model where "semi trusted users" 
do stuff in the ZMI??? 
But I digress..

If anyone knows how to solve this I would be less frustrated for a while ;-)

Regrads

Gaute Amundsen




More information about the Zope mailing list