diff --git a/modules/plugin_dbui/converter.py b/modules/plugin_dbui/converter.py index 13985703d15548f7faf501afdd208667466ffea9..b9b27195509b39a30592570104bcd089c2aef2dc 100644 --- a/modules/plugin_dbui/converter.py +++ b/modules/plugin_dbui/converter.py @@ -56,12 +56,14 @@ def _to_field(field, linkedcombo=True, **kwargs): :type field: gluon.dal.Field :type linkedcombo: bool - :param linkedcombo: ``LinkedComboBox`` are ignored when ``False``. - Useful to build grid filter. + :param linkedcombo: + ``LinkedComboBox`` are ignored when ``False``. + Useful to build grid filter. - :keyword kwargs: any Ext JS configuration parameters of the - ``Ext.form.Field`` class. They are applied in the following order: - constructor, modifiers and keyword arguments. + :keyword kwargs: + any Ext JS configuration parameters of the + ``Ext.form.Field`` class. They are applied in the following order: + constructor, modifiers and keyword arguments. :returns: Field @@ -184,16 +186,19 @@ def to_field(field, composite=True, linkedcombo=True, **kwargs): :param field: :type composite: bool - :param composite: ``FieldContainer`` is ignored when ``False``. - Useful to build grid filter. + :param composite: + ``FieldContainer`` is ignored when ``False``. + Useful to build grid filter. :type linkedcombo: bool - :param linkedcombo: ``LinkedComboBox`` are ignored when ``False``. - Useful to build grid filter. + :param linkedcombo: + ``LinkedComboBox`` are ignored when ``False``. + Useful to build grid filter. - :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. + :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. :returns: Field or ``None`` @@ -326,10 +331,11 @@ def to_formPanel(table, **kwargs): :type table: gluon.dal.Table :param table: - :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. + :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. :returns: FormPanel @@ -361,10 +367,11 @@ def to_gridColumn(field, **kwargs): :type field: gluon.dal.Field :param field: - :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. + :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. :returns: GridColumn @@ -466,9 +473,10 @@ def to_gridFilter(table, **kwargs): :type table: gluon.dal.Table :param table: - :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 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. :returns: GridFilter @@ -581,9 +589,10 @@ def to_gridPanel(table, **kwargs): :type table: gluon.dal.Table :param table: - :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 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. :returns: GridPanel @@ -625,9 +634,10 @@ def to_jsonstore(table, **kwargs): :type table: gluon.dal.Table :param table: - :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 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. :returns: DirectStore @@ -761,16 +771,19 @@ def to_panelWithUrlSelector(table, selectorTitle='Select', **kwargs): :param table: :type selectorTitle: str - :param selectorTitle: the title of the FieldSet encapsulating - the selector fields. - - :keyword baseUrl: 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. + :param selectorTitle: + the title of the FieldSet encapsulating + the selector fields. + + :keyword baseUrl: + 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. - :keyword kwargs: any of the Ext JS configuration parameters of the - ``App.panel.WithUrlSelector`` class. + :keyword kwargs: + any of the Ext JS configuration parameters of the + ``App.panel.WithUrlSelector`` class. :returns: PanelWithUrlSelector @@ -819,8 +832,9 @@ def to_viewport(**kwargs): """Build the ``Ext.Viewport`` configuration. The conversion takes into account the L{ViewportModifier} instructions. - :keyword kwargs: any of the Ext JS configuration parameters of the - ``App.viewport.Viewport`` class. + :keyword kwargs: + 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 573e8564893774be2a68d5f1b0d061bd409936c1..155c84a784179a29fe77491e25f57cd8a31fb047 100644 --- a/modules/plugin_dbui/dbsvc.py +++ b/modules/plugin_dbui/dbsvc.py @@ -111,7 +111,8 @@ class DbSvc(BaseSvc): contains the ``keywords``. :type arg: dict - :param arg: transaction data + :param arg: + transaction data - ``tableName`` the name of the table in the database @@ -161,8 +162,9 @@ class DbSvc(BaseSvc): """Encode the query send by the client to a web2py ``Query``. :type li: list - :param li: the query send by the client as a list of string. - The following string are understood by the method:: + :param li: + the query send by the client as a list of string. + The following string are understood by the method:: "[table1.field1] == [table2.field2]" or "[table1, field1] == [table2, field2]" "[table1.field1] > n" @@ -280,8 +282,9 @@ class DbSvc(BaseSvc): :param table: :type fields: dict - :param fields: key, value pairs where each key corresponds - to a ``gluon.dal.Field`` + :param fields: + key, value pairs where each key corresponds + to a ``gluon.dal.Field`` :returns: dict -- key, value pairs for each field with errors. @@ -337,7 +340,8 @@ class DbSvc(BaseSvc): The method also validates each value. :type arg: dict - :param arg: transaction data + :param arg: + transaction data - ``tableName`` the name of the table in the database @@ -425,7 +429,8 @@ class DbSvc(BaseSvc): Several transactions of the same type are processed together. :type arg: dict - :param arg: transaction data + :param arg: + transaction data - ``tableName`` the name of the tablename in the database @@ -521,7 +526,8 @@ class DbSvc(BaseSvc): Several transactions of the same type are processed together. :type arg: dict - :param arg: transaction data + :param arg: + transaction data - ``tableName`` the name of the tablename in the database @@ -600,7 +606,8 @@ class DbSvc(BaseSvc): The ``arg`` dictionary contains the following keys: :type arg: dict - :param arg: transaction data + :param arg: + transaction data - ``tableName`` the name of the table in the database @@ -728,7 +735,8 @@ class DbSvc(BaseSvc): Several transactions of the same type are processed together. :type arg: dict - :param arg: transaction data + :param arg: + transaction data - ``tableName`` the name of the tablename in the database diff --git a/modules/plugin_dbui/fieldsmodifier.py b/modules/plugin_dbui/fieldsmodifier.py index b65f3d3be6bcb156b318ae4f05cc447cfbadb21a..53b3871e48f126e1b20422ea1e28eb4ed0eff397 100644 --- a/modules/plugin_dbui/fieldsmodifier.py +++ b/modules/plugin_dbui/fieldsmodifier.py @@ -75,8 +75,9 @@ class FieldsModifier(Modifier): defined by the keyword arguments. :type field: str - :param field: name of the database field. - It should belong to the database table defined in the constructor. + :param field: + name of the database field. + It should belong to the database table defined in the constructor. """ self.data.extjs_fields[field] = kwargs diff --git a/modules/plugin_dbui/formmodifier.py b/modules/plugin_dbui/formmodifier.py index fc86b3efb2517941103c272a215b2fbd4a3b5ac8..952314115cfc09ee4268a827d0a4447096255b6f 100644 --- a/modules/plugin_dbui/formmodifier.py +++ b/modules/plugin_dbui/formmodifier.py @@ -22,8 +22,9 @@ def configure_forms(db, **extjs): Useful to set plugins in one go, for example. :type db: gluon.dal.DAL or list of table name - :param db: list of forms to be modified. They are identified by their - associated table name. + :param db: + list of forms to be modified. They are identified by their + associated table name. :note: The keyword arguments define values for the Ext JS configuration options of he ``Ext.form.Panel`` class. @@ -110,29 +111,34 @@ class FormModifier(Modifier): 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. + :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. + :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. + :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. + :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 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. """ # short cuts diff --git a/modules/plugin_dbui/gridmodifier.py b/modules/plugin_dbui/gridmodifier.py index 35bbf7ed8b5c8386a87a98df4e38df387700455b..fb4ecdb865985e60b3be8069ed4d7d5006ba3d92 100644 --- a/modules/plugin_dbui/gridmodifier.py +++ b/modules/plugin_dbui/gridmodifier.py @@ -24,8 +24,9 @@ def configure_grids(db, **extjs): Useful to set plugins in one go, for example. :type db: gluon.dal.DAL or list of table name - :param db: list of forms to be modified. They are identified by their - associated table name. + :param db: + list of forms to be modified. They are identified by their + associated table name. The keyword arguments contain the configuration options for the Ext.grid.Panel. @@ -123,7 +124,9 @@ class GridModifier(Modifier): A filter corresponds to a field in the FieldSet. :type filter: tuple - :param filter: A filter is defined by a tuple containing three strings: + :param filter: + A filter is defined by a tuple containing three strings: + - The database field name. The field has to belong to the database table defined in the constructor. However, the more elaborate syntax, ``'table2.field1'``, @@ -147,8 +150,9 @@ class GridModifier(Modifier): This method is useful to fine tune column width for example. :type fieldname: str - :param fieldname: name of a database field. - It has to belong to the table defined in the constructor. + :param fieldname: + name of a database field. + It has to belong to the table defined in the constructor. The keyword arguments defines the configuration options for the associated ``Ext.grid.Column`` widget. @@ -205,8 +209,10 @@ class GridModifier(Modifier): :keyword header: (str) the header of the TemplateColumn - :keyword tpl: (list) the template defining how fields are displayed - in the TemplateColumn. + :keyword 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, @@ -220,15 +226,18 @@ class GridModifier(Modifier): '{PeopleFirst_name}<br>', '<tpl if={PeoplePhone_number}>{PeoplePhone_number}</tpl>'] - :keyword autohide: (bool) hide the columns associated to the fields - used in the TemplateColumn when set to ``True``. + :keyword autohide: + (bool) hide the columns associated to the fields + used in the TemplateColumn when set to ``True``. - :keyword position: (int) is a number defining where the - column will be inserted in the grid widget. - The first column is at 0. + :keyword position: + (int) is a number defining where the + column will be inserted in the grid widget. + The first column is at 0. - :keyword extjs: (dict) contains the Ext JS configuration options - of the ``Ext.grid.TemplateColumn``. + :keyword extjs: + (dict) contains the Ext JS configuration options + of the ``Ext.grid.TemplateColumn``. """ keywords = ['autohide', 'position'] diff --git a/modules/plugin_dbui/helper.py b/modules/plugin_dbui/helper.py index c12ade4f7e00763bcb2779b4b0eb70b880e05439..0ab8dbf47859d838dcd941daba4c52335cc6279f 100644 --- a/modules/plugin_dbui/helper.py +++ b/modules/plugin_dbui/helper.py @@ -139,8 +139,9 @@ def encode_validator_errors(error): """Encode and translate the validator errors. :type error: dict - :param error: the key is the table field encode as C[TablenameFieldname] - while the value is the error message return by the validator + :param error: + the key is the table field encode as C[TablenameFieldname] + while the value is the error message return by the validator :returns: dict -- error message are translated and should be more friendly @@ -256,7 +257,8 @@ def get_file_paths(path, ext=None, alpha=True): The local paths are relative to the application directory. :type path: None, list or string - :param path: local path defining the target files: + :param path: + local path defining the target files: - ``None``. @@ -270,8 +272,9 @@ def get_file_paths(path, ext=None, alpha=True): :type ext: str - :param ext: select only files with the extension ``ext``, I{i.e} - ``.js``, ``.css``, ... + :param ext: + select only files with the extension ``ext``, I{i.e} + ``.js``, ``.css``, ... :type alpha: bool :param alpha: sort the paths in alphabetic order diff --git a/modules/plugin_dbui/navtree.py b/modules/plugin_dbui/navtree.py index 368d05279363af6fd6a49c5b10e6777499c78037..f8497223b09b07c7783be1c1efcfba9f635f2eb2 100644 --- a/modules/plugin_dbui/navtree.py +++ b/modules/plugin_dbui/navtree.py @@ -31,8 +31,9 @@ class Node(object): :param text: the name of the leaf :type cfg: dict - :param cfg: the Ext JS configuration options defining the widget - associated to the leaf + :param cfg: + the Ext JS configuration options defining the widget + associated to the leaf """ di = {'cfg': cfg, 'leaf': True, 'text': text} @@ -46,9 +47,10 @@ class Node(object): :param leaves: a list of string :type func: function - :param func: function translating the leaf name into - the Ext JS configuration options dictionary. - The latter defines the associated widget. + :param func: + function translating the leaf name into + the Ext JS configuration options dictionary. + The latter defines the associated widget. :type hidden: list :param hidden: List of children to be hidden. diff --git a/modules/plugin_dbui/selector.py b/modules/plugin_dbui/selector.py index 75fa129ed2a01cfbce1dc5881eb5817ac4de4954..a441cd729d5f01ef3ed4270e19a298079ec5fe0b 100644 --- a/modules/plugin_dbui/selector.py +++ b/modules/plugin_dbui/selector.py @@ -58,8 +58,9 @@ class Selector(Storage): :param table: the table containing the definition of the selector :type exclude_fields: tuple - :param exclude_fields: a list of selector field names - which have to be ignored in query and select operations. + :param exclude_fields: + a list of selector field names + which have to be ignored in query and select operations. """ diff --git a/modules/plugin_dbui/storemodifier.py b/modules/plugin_dbui/storemodifier.py index c21563c51302e71c052c1f52178d2c84573defde..ce3cee50099f53bd3cfafc1e92cc7f3a47f13c90 100644 --- a/modules/plugin_dbui/storemodifier.py +++ b/modules/plugin_dbui/storemodifier.py @@ -112,10 +112,11 @@ 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. - :param kwargs: Any configuration parameter of the ``Ext.data.Store``. - Those related to the buffering are ``buffered``, ``clearOnPaqgeLoad``, - ``leadingBufferZone``, ``pageSize``, ``purgePageCount`` - and ``trailingBufferZone``. + :param kwargs: + 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,