Commit 7cc2926b authored by Alexandre Boeglin's avatar Alexandre Boeglin

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.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19605 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f177f0cd
......@@ -451,9 +451,12 @@ def create_settings_form():
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 @@ class ERP5Form(ZMIForm, ZopePageTemplate):
# Default Attributes
pt = 'form_view'
update_action = ''
edit_order = []
# Special Settings
settings_form = create_settings_form()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment