diff --git a/modules/plugin_dbui/converter.py b/modules/plugin_dbui/converter.py index 604e61e15a5aa1d66233642ec3a2e0a5cafe5574..d38bc7e0c7dc958381c602f86eb68f79d586840d 100644 --- a/modules/plugin_dbui/converter.py +++ b/modules/plugin_dbui/converter.py @@ -54,11 +54,12 @@ def _to_field(field, linkedcombo=True, **kwargs): but does not handle :class:`.FieldContainer`. Args: - field (gluon.dal.Field): + field (gluon.dal.Field): database field + linkedcombo (bool): ``LinkedComboBox`` are ignored when ``False``. Useful to build grid filter. - :keyword kwargs: + Keyword Args: any Ext JS configuration parameters of the ``Ext.form.Field`` class. They are applied in the following order: constructor, modifiers and keyword arguments. @@ -195,16 +196,18 @@ def to_field(field, composite=True, linkedcombo=True, **kwargs): Args: field (gluon.dal.Field); + composite (bool): ``FieldContainer`` is ignored when ``False``. Useful to build grid filter. + linkedcombo (bool): ``LinkedComboBox`` are ignored when ``False``. Useful to build grid filter. - :type kwargs: dict - :param kwargs: - any Ext JS configuration parameter of the ``Ext.form.Field`` - class. They are applied in the following order: - constructor, modifiers and keyword arguments. + Keyword Args: + kwargs (dict): + any Ext JS configuration parameter of the ``Ext.form.Field`` + class. They are applied in the following order: + constructor, modifiers and keyword arguments. :returns: :class:`.Field` or ``None`` @@ -345,12 +348,12 @@ def to_formPanel(table, **kwargs): Args: table (gluon.dal.Table): database table - :type kwargs: dict - :param kwargs: - any Ext JS configuration parameter of the - ``Ext.form.Panel`` class. They are - applied in the following order: constructor, modifiers - and keyword arguments. + Keyword Args: + kwargs (dict): + any Ext JS configuration parameter of the + ``Ext.form.Panel`` class. They are + applied in the following order: constructor, modifiers + and keyword arguments. :returns: :class:`.FormPanel` @@ -383,12 +386,12 @@ def to_gridColumn(field, **kwargs): Args: field (gluon.dal.Field): database field - :type kwargs: dict - :param kwargs: - any Ext JS configuration parameter of the - ``Ext.grid.Column`` class. - They are applied in the following order: constructor, modifiers - and keyword arguments. + Keyword Args: + kwargs (dict): + any Ext JS configuration parameter of the + ``Ext.grid.Column`` class. + They are applied in the following order: constructor, modifiers + and keyword arguments. :returns: :class:`.GridColumn` @@ -492,11 +495,11 @@ def to_gridFilter(table, **kwargs): Args: table (gluon.dal.Table): database table - :type kwargs: dict - :keyword kwargs: - any of the Ext JS configuration parameters of the - ``App.grid.Filter`` class. They are applied in the following order: - constructor, modifiers, keyword arguments. + Keyword Args: + kwargs (dict): + any of the Ext JS configuration parameters of the + ``App.grid.Filter`` class. They are applied in the following order: + constructor, modifiers, keyword arguments. A filter rule is defined in the model via the :class:`.GridModifier`. @@ -614,11 +617,11 @@ def to_gridPanel(table, **kwargs): Args: table (gluon.dal.Table): database table - :type kwargs: dict - :keyword kwargs: - any of the Ext JS configuration parameters of the - ``App.grid.Panel`` class. They are applied in the following order: - constructor, modifiers, keyword arguments. + Keyword Args: + kwargs (dict): + any of the Ext JS configuration parameters of the + ``App.grid.Panel`` class. They are applied in the following order: + constructor, modifiers, keyword arguments. :returns: :class:`.GridPanel` @@ -661,11 +664,11 @@ def to_jsonstore(table, **kwargs): Args: table (gluon.dal.Table): database table - :type kwargs: dict - :keyword kwargs: - any of the Ext JS configuration parameters of the - ``App.data.DirectStore`` class. They are applied in the following order: - constructor, modifiers, keyword arguments. + Keyword Args: + kwargs (dict): + any of the Ext JS configuration parameters of the + ``App.data.DirectStore`` class. They are applied in the following order: + constructor, modifiers, keyword arguments. :returns: :class:`.DirectStore` @@ -798,17 +801,20 @@ def to_panelWithUrlSelector(table, selectorTitle='Select', **kwargs): Args: table (gluon.dal.Table): database table - selectorTitle (str): the title of the FieldSet encapsulating + + selectorTitle (str): + the title of the FieldSet encapsulating the selector fields. + baseUrl (str): the selected values are send to a controller defined by the baseUrl.Values are processed and results will be published in the panel. It is mandatory to specified the baseUrl. - :type kwargs: dict - :keyword kwargs: - any of the Ext JS configuration parameters of the - ``App.panel.WithUrlSelector`` class. + Keyword Args: + kwargs (dict): + any of the Ext JS configuration parameters of the + ``App.panel.WithUrlSelector`` class. :returns: :class:`.PanelWithUrlSelector` @@ -858,10 +864,10 @@ def to_viewport(**kwargs): The conversion takes into account the :class:`.ViewportModifier` instructions. - :type kwargs: dict - :keyword kwargs: - any of the Ext JS configuration parameters of the - ``App.viewport.Viewport`` class. + Keyword Args: + kwargs (dict): + any of the Ext JS configuration parameters of the + ``App.viewport.Viewport`` class. :returns: dict diff --git a/modules/plugin_dbui/dbsvc.py b/modules/plugin_dbui/dbsvc.py index 8dacb7c3eed7f8861a33255dee4f4b616efe7c0c..20baac9e9b879fcfa0d598e93513d07b371af957 100644 --- a/modules/plugin_dbui/dbsvc.py +++ b/modules/plugin_dbui/dbsvc.py @@ -105,9 +105,9 @@ class DbSvc(BaseSvc): Args: arg (dict): :ref:`input transaction dictionary <input transaction dictionary>` - - :type keywords: dict - :param keywords: list of keys which have to be in ``arg`` + Keyword Args: + keywords (dict): + list of keys which have to be in the ``arg`` dictionary :raise DbSvcException: when a keyword is missing or when the table diff --git a/modules/plugin_dbui/extjs.py b/modules/plugin_dbui/extjs.py index 42e7e3efff56e418cbc191638fd8795bf9c2f589..1d22d50e8c791ed510339ead52661e1fb490fc57 100644 --- a/modules/plugin_dbui/extjs.py +++ b/modules/plugin_dbui/extjs.py @@ -28,8 +28,9 @@ class Base(Storage): def __init__(self, **kwargs): """ - :type kwargs: dict - :keyword kwargs: any Ext JS configuration parameter of the target class + Keyword Args: + kwargs (dict): + any Ext JS configuration parameter of the target class :raise ExtJSException: if the keyword ``xtype`` is in the keyword arguments. diff --git a/modules/plugin_dbui/formmodifier.py b/modules/plugin_dbui/formmodifier.py index 2fc904249093453bbae1a3d9caa7e641c9db1eed..fb4ac6afe027b74e278b03d96a6f769074b003b5 100644 --- a/modules/plugin_dbui/formmodifier.py +++ b/modules/plugin_dbui/formmodifier.py @@ -111,35 +111,31 @@ class FormModifier(Modifier): * This method modify deeply the field configuration transforming the Ext.form.comboBox into App.form.LinkedComboBox. - :type master: gluon.dal.Field - :keyword master: - the field used as master. - It has to be defined in the table referenced in the constructor - and in the ``masterHasSlaveData`` table. - - :type slave: gluon.dal.Field - :keyword slave: - the field used as salve. - It has to be defined in the table referenced in the constructor - and in the ``masterHasSlaveData`` table. - - :type masterHasSlaveData: str - :keyword masterHasSlaveData: - name of the external database table. - Its contains the data defining the relation between master and slave. - It should contains fields with the name of the master and slave ones. - - :type masterExtJS: dict - :keyword masterExtJS: - configuration options dictionary for the - Ext.form.Combobox associated to the master reference field. - Might be useful to set the master in readOnly mode for example. - - :type slaveExtJS: dict - :keyword slaveExtJS: - configuration option dictionary for the - Ext.form.Combobox associated to the slave reference field. - Might be useful to set the salve in readOnly mode for example. + Keyword Args: + master (gluon.dal.Field): + the field used as master. + It has to be defined in the table referenced in the constructor + and in the ``masterHasSlaveData`` table. + + slave (gluon.dal.Field): + the field used as salve. + It has to be defined in the table referenced in the constructor + and in the ``masterHasSlaveData`` table. + + masterHasSlaveData (str): + name of the external database table. + Its contains the data defining the relation between master and slave. + It should contains fields with the name of the master and slave ones. + + masterExtJS (dict): + configuration options dictionary for the + Ext.form.Combobox associated to the master reference field. + Might be useful to set the master in readOnly mode for example. + + slaveExtJS (dict): + configuration option dictionary for the + Ext.form.Combobox associated to the slave reference field. + Might be useful to set the salve in readOnly mode for example. """ # short cuts diff --git a/modules/plugin_dbui/gridmodifier.py b/modules/plugin_dbui/gridmodifier.py index f2bfad795e2ec3fe4cdf804e3e0ae9c28e4fc9c3..0acdfed4cfe03b06b6c144bb6f9e1050d8ce0356 100644 --- a/modules/plugin_dbui/gridmodifier.py +++ b/modules/plugin_dbui/gridmodifier.py @@ -206,42 +206,39 @@ class GridModifier(Modifier): The TemplateColumn is rendered by the ``Ext.grid.TemplateColumn``. Each field is identified by its database field name. - :type header: str - :keyword header: the header of the TemplateColumn - - :type tpl: list - :keyword tpl: - the template defining how fields are displayed - in the TemplateColumn. - - * The syntax of the template is is defined in the documentation - of ``Ext.XTemplate`` constructor. - * There is some limitation when defining the template in python, - namely the use of the template member function. - * Database fields are identified using the ``CapWord`` syntax: - ``TablenameFieldname``. It works for standard and reference fields. - * HTML balises are understood. - * Example of a template list:: - - tpl = ['<b>{PeopleLast_name}</b><br>', - '{PeopleFirst_name}<br>', - '<tpl if={PeoplePhone_number}>{PeoplePhone_number}</tpl>'] - - :type autohide: bool - :keyword autohide: - hide the columns associated to the fields - used in the TemplateColumn when set to ``True``. - - :type position: int - :keyword position: - is a number defining where the - column will be inserted in the grid widget. - The first column is at 0. - - :type extjs: dict - :keyword extjs: - contains the Ext JS configuration options - of the ``Ext.grid.TemplateColumn``. + Keyword Args: + header (str): + the header of the TemplateColumn + + tpl (list): + the template defining how fields are displayed + in the TemplateColumn. + + * The syntax of the template is is defined in the documentation + of ``Ext.XTemplate`` constructor. + * There is some limitation when defining the template in python, + namely the use of the template member function. + * Database fields are identified using the ``CapWord`` syntax: + ``TablenameFieldname``. It works for standard and reference fields. + * HTML balises are understood. + * Example of a template list:: + + tpl = ['<b>{PeopleLast_name}</b><br>', + '{PeopleFirst_name}<br>', + '<tpl if={PeoplePhone_number}>{PeoplePhone_number}</tpl>'] + + autohide (bool): + hide the columns associated to the fields + used in the TemplateColumn when set to ``True``. + + position (int): + is a number defining where the + column will be inserted in the grid widget. + The first column is at 0. + + extjs (dict): + contains the Ext JS configuration options + of the ``Ext.grid.TemplateColumn``. """ keywords = ['autohide', 'position'] diff --git a/modules/plugin_dbui/navtree.py b/modules/plugin_dbui/navtree.py index 9082fa7a0011bd78209228537730e6ffd3cd67fa..b5dfc9362b6622faf8a435ab71724d9bc591c487 100644 --- a/modules/plugin_dbui/navtree.py +++ b/modules/plugin_dbui/navtree.py @@ -28,8 +28,11 @@ class Node(object): """Add a child (leaf) to the node. Args: - text (str): the name of the leaf - cfg (dict): the Ext JS configuration options defining + text (str): + the name of the leaf + + cfg (dict): + the Ext JS configuration options defining the widget associated to the leaf """ @@ -42,10 +45,12 @@ class Node(object): Args: leaves (list): a list of string + func (function): function translating the leaf name into the Ext JS configuration options dictionary. The latter defines the associated widget. + hidden (list): list of children to be hidden. .. note:: diff --git a/modules/plugin_dbui/selector.py b/modules/plugin_dbui/selector.py index 318a7dfd52d1793a26ad8828189a633410a1e63e..08c7f36ec86cfcb9308c2fcb829c596ff986f097 100644 --- a/modules/plugin_dbui/selector.py +++ b/modules/plugin_dbui/selector.py @@ -55,7 +55,7 @@ class Selector(Storage): """ Args: - table (gluon.dal.Table): + table (gluon.dal.Table): the table containing the definition of the selector exclude_fields (tuple): @@ -237,10 +237,10 @@ class Selector(Storage): table (gluon.dal.Table): database table args (list): field with operator (avg, count, max, min and sum) - :type kwargs: dict - :param kwargs: - The keyword arguments are those of the - gluon.dal.Set.select method: orderby, groupby, .... + Keyword Args: + kwargs (dict): + The keyword arguments are those of the + gluon.dal.Set.select method: orderby, groupby, .... :returns: gluon.dal.Rows diff --git a/modules/plugin_dbui/storemodifier.py b/modules/plugin_dbui/storemodifier.py index 546a1bd509f5b59b1169917eed510fb8a21890b0..73415ecb699362c24b9bfcda8a716a765d36c7b0 100644 --- a/modules/plugin_dbui/storemodifier.py +++ b/modules/plugin_dbui/storemodifier.py @@ -111,12 +111,12 @@ class StoreModifier(Modifier): That means that only 5 pages are kept in the cache. Therefore this is a good option to manipulate almost infinite set of data. - :type kwargs: dict - :param kwargs: - Any configuration parameter of the ``Ext.data.Store``. - Those related to the buffering are ``buffered``, ``clearOnPaqgeLoad``, - ``leadingBufferZone``, ``pageSize``, ``purgePageCount`` - and ``trailingBufferZone``. + Keyword Args: + kwargs (dict): + Any configuration parameter of the ``Ext.data.Store``. + Those related to the buffering are ``buffered``, ``clearOnPaqgeLoad``, + ``leadingBufferZone``, ``pageSize``, ``purgePageCount`` + and ``trailingBufferZone``. """ di = dict(autoLoad=False,