Commit 4138915e authored by Renaud Le Gac's avatar Renaud Le Gac
Browse files

Rename the all plugin configuration parameters related to modifiers.

parent 45d5dec2
......@@ -36,10 +36,10 @@ plugins = PluginManager('dbui',
base_pmathjax=dbui.get_plugin_path('plugin_mathjax'),
base_script='static/plugin_dbui/main.js',
field_modifiers={},
form_modifiers={},
grid_modifiers={},
viewport_modifiers=Storage(extjs={}))
modifier_fields={},
modifier_forms={},
modifier_grids={},
modifier_viewports=Storage(extjs={}))
# Start common services
......
......@@ -90,9 +90,9 @@ class CvtSvc(BaseSvc):
model["hidden"] = True
# Hide fields request by the grid modifiers
grid_modifiers = self.environment['plugins'].dbui.grid_modifiers
if tablename in grid_modifiers:
if fieldname in grid_modifiers[tablename].hidden_columns:
modifier_grids = self.environment['plugins'].dbui.modifier_grids
if tablename in modifier_grids:
if fieldname in modifier_grids[tablename].hidden_columns:
model["hidden"] = True
return model
......@@ -111,11 +111,11 @@ class CvtSvc(BaseSvc):
tablename = table._tablename
# get modifier requirements
grid_modifiers = self.environment['plugins'].dbui.grid_modifiers
if tablename in grid_modifiers:
configure_columns = grid_modifiers[tablename].configure_columns
delete_columns = grid_modifiers[tablename].delete_columns
template_columns = grid_modifiers[tablename].template_columns
modifier_grids = self.environment['plugins'].dbui.modifier_grids
if tablename in modifier_grids:
configure_columns = modifier_grids[tablename].configure_columns
delete_columns = modifier_grids[tablename].delete_columns
template_columns = modifier_grids[tablename].template_columns
# standard column
for field in table:
......@@ -133,7 +133,7 @@ class CvtSvc(BaseSvc):
models.insert(tpl.position, col)
# row numbering in the first column
if grid_modifiers[tablename].row_numbering:
if modifier_grids[tablename].row_numbering:
models.insert(0, {'xtype': 'rownumberer'})
......@@ -151,15 +151,15 @@ class CvtSvc(BaseSvc):
Return None if the field is used in a CompositeField
"""
field_modifiers = self.environment['plugins'].dbui.field_modifiers
modifier_fields = self.environment['plugins'].dbui.modifier_fields
table = field.table
tablename = field.tablename
# do we have composite field for this table ?
composite_fields = None
if tablename in field_modifiers:
field_modifier = field_modifiers[tablename]
composite_fields = field_modifier.composite_fields
if tablename in modifier_fields:
modifier_field = modifier_fields[tablename]
composite_fields = modifier_field.composite_fields
# main field of the composite field
# it will consume the embedded field too
......@@ -244,9 +244,9 @@ class CvtSvc(BaseSvc):
hidden = field.name == "id"
hidden = hidden or ((not field.readable) and (not field.writable))
form_modifiers = self.environment['plugins'].dbui.form_modifiers
if tablename in form_modifiers:
if fieldname in form_modifiers[tablename].hidden_fields:
modifier_forms = self.environment['plugins'].dbui.modifier_forms
if tablename in modifier_forms:
if fieldname in modifier_forms[tablename].hidden_fields:
hidden = True
if hidden:
......@@ -255,10 +255,10 @@ class CvtSvc(BaseSvc):
cfg["readOnly"] = True
# configuration options set by the field_modifers
field_modifiers = self.environment['plugins'].dbui.field_modifiers
if tablename in field_modifiers:
if fieldname in field_modifiers[tablename].extjs_fields:
cfg.update(field_modifiers[tablename].extjs_fields[fieldname])
modifier_fields = self.environment['plugins'].dbui.modifier_fields
if tablename in modifier_fields:
if fieldname in modifier_fields[tablename].extjs_fields:
cfg.update(modifier_fields[tablename].extjs_fields[fieldname])
return cfg
......@@ -274,15 +274,15 @@ class CvtSvc(BaseSvc):
items = []
form_modifiers = self.environment['plugins'].dbui.form_modifiers
modifier_forms = self.environment['plugins'].dbui.modifier_forms
tablename = table._tablename
# do we have FieldSets
field_sets, form_modifier = None, None
if tablename in form_modifiers:
form_modifier = form_modifiers[tablename]
if form_modifier and form_modifier.field_sets:
field_sets = form_modifier.field_sets
field_sets, modifier_form = None, None
if tablename in modifier_forms:
modifier_form = modifier_forms[tablename]
if modifier_form and modifier_form.field_sets:
field_sets = modifier_form.field_sets
# Table with Ext.form.FieldSet and/or Ext.form.CompositeFields
# and/or Ext.form.Field and/or Spacer
......@@ -327,8 +327,8 @@ class CvtSvc(BaseSvc):
# map the list of fields/fieldSets on Ext.form.formPanel
mapper = map_default
if form_modifier and form_modifier.mapper:
mapper = form_modifier.mapper
if modifier_form and modifier_form.mapper:
mapper = modifier_form.mapper
items = mapper(items)
......@@ -352,9 +352,9 @@ class CvtSvc(BaseSvc):
cfg['store'] = STOREID % tablename
# handle form modifier
form_modifiers = self.environment['plugins'].dbui.form_modifiers
if tablename in form_modifiers:
cfg.update(form_modifiers[tablename].extjs)
modifier_forms = self.environment['plugins'].dbui.modifier_forms
if tablename in modifier_forms:
cfg.update(modifier_forms[tablename].extjs)
return cfg
......@@ -367,11 +367,11 @@ class CvtSvc(BaseSvc):
T = self.environment['T']
tablename = table._tablename
grid_modifiers = self.environment['plugins'].dbui.grid_modifiers
if tablename not in grid_modifiers:
modifier_grids = self.environment['plugins'].dbui.modifier_grids
if tablename not in modifier_grids:
return {}
grid_filters = grid_modifiers[tablename].grid_filters
grid_filters = modifier_grids[tablename].grid_filters
if not grid_filters:
return {}
......@@ -426,9 +426,9 @@ class CvtSvc(BaseSvc):
'xtype': 'xgrid'}
# handle the user configuration option for Ext.grid.GridPanel
grid_modifiers = self.environment['plugins'].dbui.grid_modifiers
if tablename in grid_modifiers:
cfg.update(grid_modifiers[tablename].extjs)
modifier_grids = self.environment['plugins'].dbui.modifier_grids
if tablename in modifier_grids:
cfg.update(modifier_grids[tablename].extjs)
# grid with filter
filter = self.to_grid_filter(table)
......@@ -519,10 +519,10 @@ class CvtSvc(BaseSvc):
"""
cfg = []
viewport_modifiers = self.environment['plugins'].dbui.viewport_modifiers
modifier_viewports = self.environment['plugins'].dbui.modifier_viewports
if viewport_modifiers:
nav_nodes = viewport_modifiers.nodes
if modifier_viewports:
nav_nodes = modifier_viewports.nodes
for node in nav_nodes:
cfg.append(node.get_node())
......
......@@ -10,7 +10,7 @@ from gluon.storage import Storage
from modifier import Modifier
FIELD_MODIFIERS = 'field_modifiers'
MODIFIER_FIELDS = 'modifier_fields'
class FieldsModifier(Modifier):
......@@ -22,7 +22,7 @@ class FieldsModifier(Modifier):
"""Initialize the modifier persistent data.
"""
Modifier.__init__(self, FIELD_MODIFIERS, tablename)
Modifier.__init__(self, MODIFIER_FIELDS, tablename)
self.data.extjs_fields = {}
......
......@@ -10,7 +10,7 @@ from gluon.storage import Storage
from modifier import Modifier
FORM_MODIFIERS = 'form_modifiers'
MODIFIER_FORMS = 'modifier_forms'
def configure_forms(db, **extjs):
......@@ -36,7 +36,7 @@ class FormModifier(Modifier):
"""Initialize the modifier persistent data.
"""
Modifier.__init__(self, FORM_MODIFIERS, tablename)
Modifier.__init__(self, MODIFIER_FORMS, tablename)
self.data.field_sets = []
self.data.hidden_fields = []
......
......@@ -10,7 +10,7 @@ from gluon.storage import Storage
from modifier import Modifier
GRID_MODIFIERS = 'grid_modifiers'
MODIFIER_GRIDS = 'modifier_grids'
MSG_HEADER_MISSING = 'configuration option header is missing in extjs'
MSG_INVALID_KEYWORD = 'invalid keyword %s'
......@@ -46,7 +46,7 @@ class GridModifier(Modifier):
"""Initialize the modifier persistent data.
"""
Modifier.__init__(self, GRID_MODIFIERS, tablename)
Modifier.__init__(self, MODIFIER_GRIDS, tablename)
self.data.configure_columns = {}
self.data.delete_columns = []
......
......@@ -12,7 +12,7 @@ from navtree import Node
MSG_INVALID_NODE = 'Node object is not an instance of NodeBase class.'
VIEWPORT_MODIFIERS = 'viewport_modifiers'
MODIFIER_VIEWPORTS = 'modifier_viewports'
class ViewportModifier(Modifier):
......@@ -24,7 +24,7 @@ class ViewportModifier(Modifier):
"""Initialize the modifier persistent data.
"""
Modifier.__init__(self, VIEWPORT_MODIFIERS)
Modifier.__init__(self, MODIFIER_VIEWPORTS)
self.data.nodes = []
......
......@@ -4,7 +4,8 @@ HEAD
- consolidate the version 0.4.4
- Polish code and documentation as well as bug fixed
- improve API for PanelWithUrlSlector configurator
- scritp cpAdmin to add/ remove the web2py admin file
- script cpAdmin to add/ remove the web2py admin file
- Redesign the plugin configuration parameters
0.4.4 (Jan 2012)
- minor release
......
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