diff --git a/models/plugin_dbui.py b/models/plugin_dbui.py index 3c59c15e656733f5e5e857596cd1062b4b0a638f..989ba6c7575cd8bb718c246e3cce4e1a1a1c3bd2 100644 --- a/models/plugin_dbui.py +++ b/models/plugin_dbui.py @@ -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 diff --git a/modules/plugin_dbui/cvtsvc.py b/modules/plugin_dbui/cvtsvc.py index 532b6fa7d32760fc231d9db89fa1bc1eb025693d..350a24e16d5b7ad2c45d9163cf4998573ec6cc88 100644 --- a/modules/plugin_dbui/cvtsvc.py +++ b/modules/plugin_dbui/cvtsvc.py @@ -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()) diff --git a/modules/plugin_dbui/fieldsmodifier.py b/modules/plugin_dbui/fieldsmodifier.py index 1d397a0c436be592ad6cea059e4123180e5dcd25..3900f7ce472818a5df14087c49ce89ccc9c7121a 100755 --- a/modules/plugin_dbui/fieldsmodifier.py +++ b/modules/plugin_dbui/fieldsmodifier.py @@ -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 = {} diff --git a/modules/plugin_dbui/formmodifier.py b/modules/plugin_dbui/formmodifier.py index 92b70be70a3259ba0161a2206cf5c889bed9711a..dcf33150e2cbf9044e732240f9d6516195056319 100644 --- a/modules/plugin_dbui/formmodifier.py +++ b/modules/plugin_dbui/formmodifier.py @@ -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 = [] diff --git a/modules/plugin_dbui/gridmodifier.py b/modules/plugin_dbui/gridmodifier.py index 2f0425d73b651faaa2b9bae16a976aea9d5b8ceb..84458111aafa3fdd5dd0e6abfa1dc596d4e75de9 100644 --- a/modules/plugin_dbui/gridmodifier.py +++ b/modules/plugin_dbui/gridmodifier.py @@ -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 = [] diff --git a/modules/plugin_dbui/viewportmodifier.py b/modules/plugin_dbui/viewportmodifier.py index 0b708dae2bfca4a7fbef03e300581e5e015466ec..914c48d9aa14c726b4e06672e176ca4c41e58c6e 100644 --- a/modules/plugin_dbui/viewportmodifier.py +++ b/modules/plugin_dbui/viewportmodifier.py @@ -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 = [] diff --git a/static/plugin_dbui/CHANGELOG b/static/plugin_dbui/CHANGELOG index d52a9062e8aa964bd5592d2eb26174c46ea82354..10706b380bcfcc4c77b29e2fb46055b95caa1f91 100644 --- a/static/plugin_dbui/CHANGELOG +++ b/static/plugin_dbui/CHANGELOG @@ -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