From 5ac99792aa1c540c71c916b38fc5566241cd712b Mon Sep 17 00:00:00 2001 From: Jean-Paul Smets <jp@nexedi.com> Date: Fri, 25 Feb 2005 07:45:55 +0000 Subject: [PATCH] now able to initialize different Form classes git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2579 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Form/Form.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/product/ERP5Form/Form.py b/product/ERP5Form/Form.py index 2524c42081..f196e2fce3 100755 --- a/product/ERP5Form/Form.py +++ b/product/ERP5Form/Form.py @@ -201,11 +201,11 @@ def add_and_edit(self, id, REQUEST): u = "%s/%s" % (u, quote(id)) 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. """ - form_class = ERP5Form - + if form_class is None: form_class = ERP5Form + meta_types = [] 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 @@ -276,16 +276,14 @@ def create_settings_form(): required=0, size=1, default=None) - encoding = fields.StringField('encoding', title='Encoding of pages the form is in', default="UTF-8", required=1) - stored_encoding = fields.StringField('stored_encoding', title='Encoding of form properties', default='UTF-8', - required=1) + required=1) unicode_mode = fields.CheckBoxField('unicode_mode', title='Form properties are unicode', default=0, @@ -451,6 +449,4 @@ psyco.bind(Field.get_value) #psyco.bind(PageTemplate.pt_macros) #from Products.CMFCore.ActionsTool import ActionsTool -#psyco.bind(ActionsTool.listFilteredActionsFor) - - +#psyco.bind(ActionsTool.listFilteredActionsFor) \ No newline at end of file -- 2.30.9