diff --git a/docs/api/generated/modifier/plugin_dbui.modifier.Modifier.configure.rst b/docs/api/generated/modifier/plugin_dbui.modifier.Modifier.configure.rst new file mode 100644 index 0000000000000000000000000000000000000000..f8470003fcda3aaba475e0ef6e8ef964cc00981f --- /dev/null +++ b/docs/api/generated/modifier/plugin_dbui.modifier.Modifier.configure.rst @@ -0,0 +1,6 @@ +plugin_dbui.modifier.Modifier.configure +======================================= + +.. currentmodule:: plugin_dbui.modifier + +.. automethod:: Modifier.configure \ No newline at end of file diff --git a/docs/api/generated/plugin_dbui.modifier.Modifier.rst b/docs/api/generated/plugin_dbui.modifier.Modifier.rst new file mode 100644 index 0000000000000000000000000000000000000000..af926adde528cd7a5bc34fba89a28754692b2af4 --- /dev/null +++ b/docs/api/generated/plugin_dbui.modifier.Modifier.rst @@ -0,0 +1,18 @@ +plugin_dbui.modifier.Modifier +============================= + +.. currentmodule:: plugin_dbui.modifier + +.. autoclass:: Modifier + + .. rubric:: Methods + + .. autosummary:: + :toctree: modifier/ + + ~Modifier.configure + + + + + diff --git a/modules/plugin_dbui/modifier.py b/modules/plugin_dbui/modifier.py index 551b8e49b32b2b17e36505b2f89bcdcbb1d0ab82..d87237d82a82797c9d5b4f0cb718bed94aa1af28 100644 --- a/modules/plugin_dbui/modifier.py +++ b/modules/plugin_dbui/modifier.py @@ -12,37 +12,38 @@ MSG_INVALID_TYPE = "Invalid plugin type" class Modifier(object): """Base class to construct Modifier tools. - Attributes: - data (gluon.storage.Storage): + Args: + dpname (str): name of the data point. + tablename (str):name of the database table. - """ + Notes: + * A modifier stores its instructions in a global buffer + handles by the web2py ``PluginManager``. - def __init__(self, dpname, tablename=None): - """Create the ``gluon.storage.Storage`` in the plugin dbui to house - modifier information. + * The instructions are kept in a ``gluon.storage.Storage``. + Its path is defined by the ``dpname`` and ``tablename`` arguments. - * The path to access to the Storage is defined by the ``dpname`` - and ``tablename``. - * The ``Storage`` is linked to the class attribute ``data``. - * The ``Storage`` can be accessed outside the modifier - in the following way:: + * The storage can be accessed from anywhere:: - p = PluginManager('dbui') - modifier = p.dbui[dpname] + p = PluginManager('dbui') + modifier = p.dbui[dpname] - or when the tablename is defined:: + or when the ``tablename`` is defined:: - p = PluginManager('dbui') - modifier = p.dbui[dpname][tablename] + p = PluginManager('dbui') + modifier = p.dbui[dpname][tablename] - * The ``Storage`` contains the ``extjs`` key to store - configuration parameter of the associate Ext JS widget. + Attributes: + data (gluon.storage.Storage): contains all the instructions. + It has one key/attribute: - Args: - dpname (str): name of the data point. - tablename (str):name of the database table. + * **extjs** to store configuration options + of the associate Ext JS widget. + + """ + + def __init__(self, dpname, tablename=None): - """ p = PluginManager('dbui') if tablename: @@ -64,7 +65,10 @@ class Modifier(object): def configure(self, **extjs): """Set the configuration parameters for the associated Ext JS widget. - .. note:: + Keyword Args: + **extjs: any configuration options of the associated Ext JS widget. + + Notes: * Existing value of the configuration parameters are replaced by those defined in the keyword arguments. @@ -75,9 +79,9 @@ class Modifier(object): If a plugin with the same ptype alsready exists in the list it is replaced by the new definition. - * A plugin is defined by a string containing is ``pType``. + * A plugin can be defined by a string containing is ``pType``. - * A plugin is defined by a dictionary containing the ``pType`` + * A plugin can be defined by a dictionary containing the ``pType`` and the plugin configuration options:: {'ptype': foo, 'option1': val,...}