Commit f8e1f624 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Remove all_editable_columns and default, since they are not in use.

Change the style of defining properties for more maintainability.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7319 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dc8e5d22
...@@ -299,31 +299,19 @@ class ListBoxWidget(Widget.Widget): ...@@ -299,31 +299,19 @@ class ListBoxWidget(Widget.Widget):
- sort_order -- the order of sorting - sort_order -- the order of sorting
""" """
property_names = Widget.Widget.property_names +\ # Define Properties for ListBoxWidget.
['lines', 'columns', 'all_columns', 'search_columns', 'sort_columns', 'sort', property_names = list(Widget.Widget.property_names)
'editable_columns', 'all_editable_columns',
'stat_columns', 'url_columns', 'global_attributes', # Default has no meaning in ListBox.
'list_method', 'count_method', 'stat_method', 'selection_name', property_names.remove('default')
'meta_types', 'portal_types', 'default_params',
'search', 'select',
'domain_tree', 'domain_root_list',
'report_tree', 'report_root_list',
'list_action' ]
default = fields.TextAreaField('default',
title='Default',
description=(
"Default value of the text in the widget."),
default="",
width=20, height=3,
required=0)
lines = fields.IntegerField('lines', lines = fields.IntegerField('lines',
title='Lines', title='Lines',
description=( description=(
"The number of lines of this list. Required."), "The number of lines of this list. Required."),
default=10, default=20,
required=1) required=1)
property_names.append('lines')
columns = fields.ListTextAreaField('columns', columns = fields.ListTextAreaField('columns',
title="Columns", title="Columns",
...@@ -331,6 +319,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -331,6 +319,7 @@ class ListBoxWidget(Widget.Widget):
"A list of attributes names to display. Required."), "A list of attributes names to display. Required."),
default=[], default=[],
required=1) required=1)
property_names.append('columns')
all_columns = fields.ListTextAreaField('all_columns', all_columns = fields.ListTextAreaField('all_columns',
title="More Columns", title="More Columns",
...@@ -338,6 +327,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -338,6 +327,7 @@ class ListBoxWidget(Widget.Widget):
"An optional list of attributes names to display."), "An optional list of attributes names to display."),
default=[], default=[],
required=0) required=0)
property_names.append('all_columns')
search_columns = fields.ListTextAreaField('search_columns', search_columns = fields.ListTextAreaField('search_columns',
title="Searchable Columns", title="Searchable Columns",
...@@ -345,6 +335,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -345,6 +335,7 @@ class ListBoxWidget(Widget.Widget):
"An optional list of columns to search."), "An optional list of columns to search."),
default=[], default=[],
required=0) required=0)
property_names.append('search_columns')
sort_columns = fields.ListTextAreaField('sort_columns', sort_columns = fields.ListTextAreaField('sort_columns',
title="Sortable Columns", title="Sortable Columns",
...@@ -352,12 +343,14 @@ class ListBoxWidget(Widget.Widget): ...@@ -352,12 +343,14 @@ class ListBoxWidget(Widget.Widget):
"An optional list of columns to sort."), "An optional list of columns to sort."),
default=[], default=[],
required=0) required=0)
property_names.append('sort_columns')
sort = fields.ListTextAreaField('sort', sort = fields.ListTextAreaField('sort',
title='Default Sort', title='Default Sort',
description=('The default sort keys and order'), description=('The default sort keys and order'),
default=[], default=[],
required=0) required=0)
property_names.append('sort')
list_method = fields.MethodField('list_method', list_method = fields.MethodField('list_method',
title='List Method', title='List Method',
...@@ -365,6 +358,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -365,6 +358,7 @@ class ListBoxWidget(Widget.Widget):
'objects'), 'objects'),
default='', default='',
required=0) required=0)
property_names.append('list_method')
count_method = fields.MethodField('count_method', count_method = fields.MethodField('count_method',
title='Count Method', title='Count Method',
...@@ -372,6 +366,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -372,6 +366,7 @@ class ListBoxWidget(Widget.Widget):
'objects'), 'objects'),
default='', default='',
required=0) required=0)
property_names.append('count_method')
stat_method = fields.MethodField('stat_method', stat_method = fields.MethodField('stat_method',
title='Stat Method', title='Stat Method',
...@@ -379,6 +374,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -379,6 +374,7 @@ class ListBoxWidget(Widget.Widget):
'objects'), 'objects'),
default='', default='',
required=0) required=0)
property_names.append('stat_method')
selection_name = fields.StringField('selection_name', selection_name = fields.StringField('selection_name',
title='Selection Name', title='Selection Name',
...@@ -386,6 +382,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -386,6 +382,7 @@ class ListBoxWidget(Widget.Widget):
'params of selection'), 'params of selection'),
default='', default='',
required=0) required=0)
property_names.append('selection_name')
meta_types = fields.ListTextAreaField('meta_types', meta_types = fields.ListTextAreaField('meta_types',
title="Meta Types", title="Meta Types",
...@@ -393,6 +390,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -393,6 +390,7 @@ class ListBoxWidget(Widget.Widget):
"Meta Types of objects to list. Required."), "Meta Types of objects to list. Required."),
default=[], default=[],
required=0) required=0)
property_names.append('meta_types')
portal_types = fields.ListTextAreaField('portal_types', portal_types = fields.ListTextAreaField('portal_types',
title="Portal Types", title="Portal Types",
...@@ -400,25 +398,30 @@ class ListBoxWidget(Widget.Widget): ...@@ -400,25 +398,30 @@ class ListBoxWidget(Widget.Widget):
"Portal Types of objects to list. Required."), "Portal Types of objects to list. Required."),
default=[], default=[],
required=0) required=0)
property_names.append('portal_types')
# XXX Do we still need this?
default_params = fields.ListTextAreaField('default_params', default_params = fields.ListTextAreaField('default_params',
title="Default Parameters", title="Default Parameters",
description=( description=(
"Default Parameters for the List Method."), "Default Parameters for the List Method."),
default=[], default=[],
required=0) required=0)
property_names.append('default_params')
search = fields.CheckBoxField('search', search = fields.CheckBoxField('search',
title='Search Row', title='Search Row',
description=('Search Row'), description=('Search Row'),
default='', default='',
required=0) required=0)
property_names.append('search')
select = fields.CheckBoxField('select', select = fields.CheckBoxField('select',
title='Select Column', title='Select Column',
description=('Select Column'), description=('Select Column'),
default='', default='',
required=0) required=0)
property_names.append('select')
editable_columns = fields.ListTextAreaField('editable_columns', editable_columns = fields.ListTextAreaField('editable_columns',
title="Editable Columns", title="Editable Columns",
...@@ -426,13 +429,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -426,13 +429,7 @@ class ListBoxWidget(Widget.Widget):
"An optional list of columns which can be modified."), "An optional list of columns which can be modified."),
default=[], default=[],
required=0) required=0)
property_names.append('editable_columns')
all_editable_columns = fields.ListTextAreaField('all_editable_columns',
title="All Editable Columns",
description=(
"An optional list of columns which can be modified."),
default=[],
required=0)
stat_columns = fields.ListTextAreaField('stat_columns', stat_columns = fields.ListTextAreaField('stat_columns',
title="Stat Columns", title="Stat Columns",
...@@ -440,6 +437,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -440,6 +437,7 @@ class ListBoxWidget(Widget.Widget):
"An optional list of columns which can be used for statistics."), "An optional list of columns which can be used for statistics."),
default=[], default=[],
required=0) required=0)
property_names.append('stat_columns')
url_columns = fields.ListTextAreaField('url_columns', url_columns = fields.ListTextAreaField('url_columns',
title="URL Columns", title="URL Columns",
...@@ -447,19 +445,23 @@ class ListBoxWidget(Widget.Widget): ...@@ -447,19 +445,23 @@ class ListBoxWidget(Widget.Widget):
"An optional list of columns which can provide a custom URL."), "An optional list of columns which can provide a custom URL."),
default=[], default=[],
required=0) required=0)
property_names.append('url_columns')
# XXX do we still need this?
global_attributes = fields.ListTextAreaField('global_attributes', global_attributes = fields.ListTextAreaField('global_attributes',
title="Global Attributes", title="Global Attributes",
description=( description=(
"An optional list of attributes which are set by hidden fields and which are applied to each editable column."), "An optional list of attributes which are set by hidden fields and which are applied to each editable column."),
default=[], default=[],
required=0) required=0)
property_names.append('global_attributes')
domain_tree = fields.CheckBoxField('domain_tree', domain_tree = fields.CheckBoxField('domain_tree',
title='Domain Tree', title='Domain Tree',
description=('Selection Tree'), description=('Selection Tree'),
default='', default='',
required=0) required=0)
property_names.append('domain_tree')
domain_root_list = fields.ListTextAreaField('domain_root_list', domain_root_list = fields.ListTextAreaField('domain_root_list',
title="Domain Root", title="Domain Root",
...@@ -467,14 +469,14 @@ class ListBoxWidget(Widget.Widget): ...@@ -467,14 +469,14 @@ class ListBoxWidget(Widget.Widget):
"A list of domains which define the possible root."), "A list of domains which define the possible root."),
default=[], default=[],
required=0) required=0)
property_names.append('domain_root_list')
report_tree = fields.CheckBoxField('report_tree', report_tree = fields.CheckBoxField('report_tree',
title='Report Tree', title='Report Tree',
description=('Report Tree'), description=('Report Tree'),
default='', default='',
required=0) required=0)
property_names.append('report_tree')
report_root_list = fields.ListTextAreaField('report_root_list', report_root_list = fields.ListTextAreaField('report_root_list',
title="Report Root", title="Report Root",
...@@ -482,13 +484,15 @@ class ListBoxWidget(Widget.Widget): ...@@ -482,13 +484,15 @@ class ListBoxWidget(Widget.Widget):
"A list of domains which define the possible root."), "A list of domains which define the possible root."),
default=[], default=[],
required=0) required=0)
property_names.append('report_root_list')
list_action = fields.StringField('list_action', list_action = fields.StringField('list_action',
title='List Action', title='List Action',
description=('The id of the object action' description=('The id of the object action'
'to display the current list'), 'to display the current list'),
default='', default='list',
required=1) required=1)
property_names.append('list_action')
def render_view(self, field, value, REQUEST=None, render_format='html', key='listbox'): def render_view(self, field, value, REQUEST=None, render_format='html', key='listbox'):
""" """
......
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