[Erp5-report] r19605 - /erp5/trunk/products/ERP5Form/Form.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Feb 29 17:04:17 CET 2008
Author: alex
Date: Fri Feb 29 17:04:15 2008
New Revision: 19605
URL: http://svn.erp5.org?rev=19605&view=rev
Log:
Add edit_order property to ERP5Form, that allows to define in which order the
setters for some properties of the form should be called by edit().
This is usefull, for example, when property A acquires its default value from
property B, and both are editable in the same form. We don't want A to be set
to B's old value when the user changes B's value and A had no value set.
Modified:
erp5/trunk/products/ERP5Form/Form.py
Modified: erp5/trunk/products/ERP5Form/Form.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/Form.py?rev=19605&r1=19604&r2=19605&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/Form.py (original)
+++ erp5/trunk/products/ERP5Form/Form.py Fri Feb 29 17:04:15 2008
@@ -451,9 +451,12 @@
title='Form properties are unicode',
default=0,
required=1)
+ edit_order = fields.LinesField('edit_order',
+ title='Setters for these properties should be'
+ '<br /> called by edit() in the defined order')
form.add_fields([title, description, row_length, name, pt, action, update_action, method,
- enctype, encoding, stored_encoding, unicode_mode])
+ enctype, encoding, stored_encoding, unicode_mode, edit_order])
return form
class ERP5Form(ZMIForm, ZopePageTemplate):
@@ -496,6 +499,7 @@
# Default Attributes
pt = 'form_view'
update_action = ''
+ edit_order = []
# Special Settings
settings_form = create_settings_form()
More information about the Erp5-report
mailing list