Commit e22553d4 authored by Jérome Perrin's avatar Jérome Perrin

Initialize form groups with left, right, center, bottom and hidden



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10256 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 60b40ce0
...@@ -352,6 +352,8 @@ class ERP5Form(ZMIForm, ZopePageTemplate): ...@@ -352,6 +352,8 @@ class ERP5Form(ZMIForm, ZopePageTemplate):
self.id = id self.id = id
self.title = title self.title = title
self.row_length = 4 self.row_length = 4
self.group_list = ["left", "right", "center", "bottom", "hidden"]
self.groups = dict.fromkeys(self.group_list, [])
# Proxy method to PageTemplate # Proxy method to PageTemplate
def __call__(self, *args, **kwargs): def __call__(self, *args, **kwargs):
...@@ -402,7 +404,6 @@ class ERP5Form(ZMIForm, ZopePageTemplate): ...@@ -402,7 +404,6 @@ class ERP5Form(ZMIForm, ZopePageTemplate):
if they occur and raise a FormValidationError in the end if any if they occur and raise a FormValidationError in the end if any
Validation Errors occured. Validation Errors occured.
""" """
# import pdb; pdb.set_trace()
result = {} result = {}
errors = [] errors = []
for group in self.get_groups(): for group in self.get_groups():
...@@ -431,6 +432,7 @@ class ERP5Form(ZMIForm, ZopePageTemplate): ...@@ -431,6 +432,7 @@ class ERP5Form(ZMIForm, ZopePageTemplate):
errors.append(err) errors.append(err)
except KeyError, err: except KeyError, err:
LOG('ERP5Form/Form.py:validate_all', 0, 'KeyError : %s' % (err, )) LOG('ERP5Form/Form.py:validate_all', 0, 'KeyError : %s' % (err, ))
if len(errors) > 0: if len(errors) > 0:
raise FormValidationError(errors, result) raise FormValidationError(errors, result)
return result return result
......
...@@ -115,19 +115,6 @@ class ERP5Report(ERP5Form): ...@@ -115,19 +115,6 @@ class ERP5Report(ERP5Form):
# Default Attributes # Default Attributes
pt = 'report_view' pt = 'report_view'
def __init__(self, id, title, unicode_mode=0,
encoding='UTF-8', stored_encoding='UTF-8'):
"""Initialize form.
id -- id of form
title -- the title of the form
"""
ZMIForm.inheritedAttribute('__init__')(self, "", "POST", "", id,
encoding, stored_encoding,
unicode_mode)
self.id = id
self.title = title
self.row_length = 4
# Proxy method to PageTemplate # Proxy method to PageTemplate
def __call__(self, *args, **kwargs): def __call__(self, *args, **kwargs):
if not kwargs.has_key('args'): if not kwargs.has_key('args'):
......
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