Commit ef896f0a authored by Alexandre Boeglin's avatar Alexandre Boeglin

Contributed by Patrick Gerken: Allows to render a ParallelListField subfields

as read-only.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10647 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f873b3e0
...@@ -131,12 +131,18 @@ class ParallelListWidget(Widget.MultiListWidget, ...@@ -131,12 +131,18 @@ class ParallelListWidget(Widget.MultiListWidget,
REQUEST.set('_v_plf_first_item', 0) REQUEST.set('_v_plf_first_item', 0)
REQUEST.set('_v_plf_items', sub_field_property_dict['item_list']) REQUEST.set('_v_plf_items', sub_field_property_dict['item_list'])
REQUEST.set('_v_plf_size', sub_field_property_dict['size']) REQUEST.set('_v_plf_size', sub_field_property_dict['size'])
return self.sub_widget[sub_field_property_dict['field_type']].render( if sub_field_property_dict.get('editable', 1):
field, return self.sub_widget[sub_field_property_dict['field_type']].render(
field.generate_subfield_key(sub_field_property_dict['key'], field,
key=key), field.generate_subfield_key(sub_field_property_dict['key'],
sub_field_property_dict['value'], key=key),
REQUEST) sub_field_property_dict['value'],
REQUEST)
else:
return self.sub_widget[sub_field_property_dict['field_type']].render_view(
field,
sub_field_property_dict['value'],
)
class ParallelListValidator(Validator.MultiSelectionValidator): class ParallelListValidator(Validator.MultiSelectionValidator):
...@@ -230,7 +236,8 @@ class ParallelListField(ZMIField): ...@@ -230,7 +236,8 @@ class ParallelListField(ZMIField):
'item_list': [], 'item_list': [],
'value': [], 'value': [],
'is_right_display': 0, 'is_right_display': 0,
'size': 5 'size': 5,
'editable' : self.get_value('editable')
} }
hash_list = [] hash_list = []
......
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