Commit 5ac99792 authored by Jean-Paul Smets's avatar Jean-Paul Smets

now able to initialize different Form classes


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2579 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 150f1afe
...@@ -201,11 +201,11 @@ def add_and_edit(self, id, REQUEST): ...@@ -201,11 +201,11 @@ def add_and_edit(self, id, REQUEST):
u = "%s/%s" % (u, quote(id)) u = "%s/%s" % (u, quote(id))
REQUEST.RESPONSE.redirect(u+'/manage_main') REQUEST.RESPONSE.redirect(u+'/manage_main')
def initializeForm(field_registry): def initializeForm(field_registry, form_class=None):
"""Sets up ZMIForm with fields from field_registry. """Sets up ZMIForm with fields from field_registry.
""" """
form_class = ERP5Form if form_class is None: form_class = ERP5Form
meta_types = [] meta_types = []
for meta_type, field in field_registry.get_field_classes().items(): for meta_type, field in field_registry.get_field_classes().items():
# don't set up in form if this is a field for internal use only # don't set up in form if this is a field for internal use only
...@@ -276,16 +276,14 @@ def create_settings_form(): ...@@ -276,16 +276,14 @@ def create_settings_form():
required=0, required=0,
size=1, size=1,
default=None) default=None)
encoding = fields.StringField('encoding', encoding = fields.StringField('encoding',
title='Encoding of pages the form is in', title='Encoding of pages the form is in',
default="UTF-8", default="UTF-8",
required=1) required=1)
stored_encoding = fields.StringField('stored_encoding', stored_encoding = fields.StringField('stored_encoding',
title='Encoding of form properties', title='Encoding of form properties',
default='UTF-8', default='UTF-8',
required=1) required=1)
unicode_mode = fields.CheckBoxField('unicode_mode', unicode_mode = fields.CheckBoxField('unicode_mode',
title='Form properties are unicode', title='Form properties are unicode',
default=0, default=0,
...@@ -451,6 +449,4 @@ psyco.bind(Field.get_value) ...@@ -451,6 +449,4 @@ psyco.bind(Field.get_value)
#psyco.bind(PageTemplate.pt_macros) #psyco.bind(PageTemplate.pt_macros)
#from Products.CMFCore.ActionsTool import ActionsTool #from Products.CMFCore.ActionsTool import ActionsTool
#psyco.bind(ActionsTool.listFilteredActionsFor) #psyco.bind(ActionsTool.listFilteredActionsFor)
\ No newline at end of file
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