Commit ec2c1ed9 authored by Yusei Tahara's avatar Yusei Tahara

2007-08-07 yusei

Move ListBox edit code from Base_edit to ERP5Form.ListBox module.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15537 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 50786ab8
......@@ -107,19 +107,6 @@ except FormValidationError, validation_errors:\n
value(request)\n
return form(request)\n
\n
def editListBox(listbox_field, listbox):\n
""" Function called to edit a listbox\n
"""\n
if listbox is not None:\n
gv = {}\n
if listbox_field.has_value(\'global_attributes\'):\n
hidden_attributes = map(lambda x:x[0], listbox_field.get_value(\'global_attributes\'))\n
for k in hidden_attributes:\n
gv[k] = getattr(request, k, None)\n
for url, v in listbox.items():\n
v.update(gv)\n
context.restrictedTraverse(url).edit(**v)\n
\n
def editMatrixBox(matrixbox_field, matrixbox):\n
""" Function called to edit a Matrix box\n
"""\n
......@@ -225,9 +212,7 @@ try:\n
# then we edit them\n
for field in form.get_fields():\n
parseField(field)\n
if(field.meta_type == \'ListBox\'):\n
editListBox(field, request.get(field.id))\n
elif(field.meta_type == \'MatrixBox\'):\n
if(field.meta_type == \'MatrixBox\'):\n
editMatrixBox(field, request.get(field.id))\n
\n
# Maybe we should build a list of objects we need\n
......@@ -330,7 +315,6 @@ return request[\'RESPONSE\'].redirect(redirect_url)\n
<string>field_id</string>
<string>value</string>
<string>callable</string>
<string>editListBox</string>
<string>editMatrixBox</string>
<string>MARKER</string>
<string>kw</string>
......
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