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,10 +201,10 @@ def add_and_edit(self, id, REQUEST): ...@@ -201,10 +201,10 @@ 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():
...@@ -276,12 +276,10 @@ def create_settings_form(): ...@@ -276,12 +276,10 @@ 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',
...@@ -452,5 +450,3 @@ psyco.bind(Field.get_value) ...@@ -452,5 +450,3 @@ psyco.bind(Field.get_value)
#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