diff --git a/modules/plugin_dbui/__init__.py b/modules/plugin_dbui/__init__.py index 21407f471efcafd87a5c9aaff1c808eabfa338a1..d149d203a23108aeb92ee1ba37dc690326c5e274 100644 --- a/modules/plugin_dbui/__init__.py +++ b/modules/plugin_dbui/__init__.py @@ -1,4 +1,10 @@ -""" Author: R. Le Gac +""" The package is structured in several modules. +The most import ones are: + + * *constant* + * *helper* a set of helper functions. + * *formmodifier* and *gridmodifier*, *viewportmodifier* + * *dbsvc* linking the user interface to the database """ from callback import INHIBIT_DELETE_UNDEF, INHIBIT_UPDATE_UNDEF diff --git a/modules/plugin_dbui/basesvc.py b/modules/plugin_dbui/basesvc.py index b6f1c2748371212685356b7b61697bfa5d806db1..8a128a42fafb5253d8c7c1ae9a6e6874b11c1f85 100644 --- a/modules/plugin_dbui/basesvc.py +++ b/modules/plugin_dbui/basesvc.py @@ -1,7 +1,5 @@ """ base class to build service -@author: R. Le Gac - """ import pprint @@ -16,7 +14,7 @@ class BaseSvc: def dbg(self, *args): - """Print C{args} if the attribute debug is true. + """Print ``args`` if the attribute debug is true. """ if self.debug: diff --git a/modules/plugin_dbui/callback.py b/modules/plugin_dbui/callback.py index 615a57eb6cd4b4bd88faad324b8cd15bfdf682e0..17303a4745693d5c86b8267a3a673b9d976881e1 100644 --- a/modules/plugin_dbui/callback.py +++ b/modules/plugin_dbui/callback.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ callback -@author: R. Le Gac - """ from constant import UNDEF_ID from dbsvc import CALLBACK_ERRORS @@ -12,11 +10,10 @@ from gluon import current def INHIBIT_DELETE_UNDEF(set): """Delete the row containing undefined value is not allowed - @type set: gluon.dal.Set - @param set: + :type set: gluon.dal.Set + :param set: - @rtype: bool - @return: + :returns: bool """ db, T = current.globalenv['db'], current.T @@ -39,11 +36,10 @@ def INHIBIT_DELETE_UNDEF(set): def INHIBIT_UPDATE_UNDEF(set, values): """Update the row containing undefined value is not allowed - @type set: gluon.dal.Set - @param set: + :type set: gluon.dal.Set + :param set: - @rtype: bool - @return: + :returns: bool """ db, T = current.globalenv['db'], current.T diff --git a/modules/plugin_dbui/constant.py b/modules/plugin_dbui/constant.py index 99b44015c782eeeb716732d4ed8118d3fc1bca33..1567a6f8fffd8605ded45adccc3be5d076ebb501 100644 --- a/modules/plugin_dbui/constant.py +++ b/modules/plugin_dbui/constant.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ constant -@author: R. Le Gac - """ INLINE_ALERT = "<script>Ext.Msg.alert('%s', '%s');</script>" UNDEF = 'undefined' diff --git a/modules/plugin_dbui/converter.py b/modules/plugin_dbui/converter.py index f144fb7046bb11a5539c3fec2f2357e1826fd13b..9fd88dbe766f471db56d461dec85282d2ea847ea 100644 --- a/modules/plugin_dbui/converter.py +++ b/modules/plugin_dbui/converter.py @@ -1,7 +1,5 @@ """ a series of converter to transform L{gluon.dal} objects into Ext JS widgets. -@author: R. Le Gac - """ import gluon.dal import re @@ -54,25 +52,25 @@ def _to_field(field, linkedcombo=True, **kwargs): The conversion takes into account the L{FieldsModifier} instructions but does not handle C{FieldContainer}. - @param field: - @type field: gluon.dal.Field + :param field: + :type field: gluon.dal.Field - @type linkedcombo: bool - @param linkedcombo: C{LinkedComboBox} are ignored when C{False}. + :type linkedcombo: bool + :param linkedcombo: C{LinkedComboBox} are ignored when C{False}. Useful to build grid filter. - @keyword kwargs: any Ext JS configuration parameters of the + :keyword kwargs: any Ext JS configuration parameters of the C{Ext.form.Field} class. They are applied in the following order: constructor, modifiers and keyword arguments. - @rtype: Field + :returns: Field - @note: The return configurator is a L{Field}. However it can be a + :note: The return configurator is a L{Field}. However it can be a L{ComboBox}, a L{FieldDate}, a L{FieldTextArea}, ... depending on the C{type} of the database field. The association is defined in the dictionary L{FTYPE_TO_XTYPE}. - @attention: It is recommended to used the more general method L{to_field} + :attention: It is recommended to used the more general method L{to_field} which also understands C{FieldContainer}. """ @@ -174,32 +172,32 @@ def to_field(field, composite=True, linkedcombo=True, **kwargs): The conversion handles L{FieldContainer} and takes into account the C{FieldsModifier} instructions. - @note: The return configurator is a L{Field}. However it can be a + :note: The return configurator is a L{Field}. However it can be a L{ComboBox}, a L{FieldDate}, a L{FieldTextArea}, ... depending on the C{type} of the database field. The association is defined in the dictionary L{FTYPE_TO_XTYPE}. - @note: The database fields can be organized in L{FieldContainer} + :note: The database fields can be organized in L{FieldContainer} in the application model using the modifiers L{FieldsModifier}. - @type field: gluon.dal.Field - @param field: + :type field: gluon.dal.Field + :param field: - @type composite: bool - @param composite: C{FieldContainer} is ignored when C{False}. + :type composite: bool + :param composite: C{FieldContainer} is ignored when C{False}. Useful to build grid filter. - @type linkedcombo: bool - @param linkedcombo: C{LinkedComboBox} are ignored when C{False}. + :type linkedcombo: bool + :param linkedcombo: C{LinkedComboBox} are ignored when C{False}. Useful to build grid filter. - @param kwargs: any Ext JS configuration parameter of the C{Ext.form.Field} + :param kwargs: any Ext JS configuration parameter of the C{Ext.form.Field} class. They are applied in the following order: constructor, modifiers and keyword arguments. - @rtype: Field or C{None} + :retruns: Field or C{None} - @note: Return None when composite is C{True} and when + :note: Return None when composite is C{True} and when the field is consumed by a C{FieldContainer}. """ @@ -244,19 +242,19 @@ def to_fields(table): """Build the list L{Field} configuration for each field of the database C{table}. - @note: The return configuration is a L{Field}. However it can be a + :note: The return configuration is a L{Field}. However it can be a L{ComboBox}, a L{FieldDate}, a L{FieldTextArea}, ... depending on the C{type} of the database field. The association is defined in the dictionary L{FTYPE_TO_XTYPE}. - @note: The function handles L{FieldSet} and L{FieldContainer} + :note: The function handles L{FieldSet} and L{FieldContainer} as well as the L{FieldsModifier} instructions. The C{FieldSet} and C{FieldContainer} can be defined in the application model using the modifier L{FormModifier} and the L{FieldsModifier} respectively. - @type table: gluon.dal.Table - @rtype: list + :type table: gluon.dal.Table + :returns: list """ li = [] @@ -325,15 +323,15 @@ def to_formPanel(table, **kwargs): """Build the L{FormPanel} configuration for the database C{table}. The conversion takes into account the L{FormModifier} instructions. - @type table: gluon.dal.Table - @param table: + :type table: gluon.dal.Table + :param table: - @param kwargs: any Ext JS configuration parameter of the + :param kwargs: any Ext JS configuration parameter of the C{Ext.form.Panel} class. They are applied in the following order: constructor, modifiers and keyword arguments. - @rtype: FormPanel + :returns: FormPanel """ tablename = table._tablename @@ -360,15 +358,15 @@ def to_gridColumn(field, **kwargs): """Build the L{GridColumn} configuration for the database C{field}. The conversion takes into account the L{GridModifier} instructions. - @type field: gluon.dal.Field - @param field: + :type field: gluon.dal.Field + :param field: - @param kwargs: any Ext JS configuration parameter of the + :param kwargs: any Ext JS configuration parameter of the C{Ext.grid.Column} class. They are applied in the following order: constructor, modifiers and keyword arguments. - @rtype: GridColumn + :returns: GridColumn """ T = current.T @@ -423,10 +421,10 @@ def to_gridColumnModel(table): """Build the L{GridColumnModel} configuration for the database C{table}. The conversion takes into account the L{GridModifier} instructions. - @type table: gluon.dal.Table - @param table: + :type table: gluon.dal.Table + :param table: - @rtype: GridColumnModel + :returns: GridColumnModel """ delete_columns = [] @@ -465,19 +463,19 @@ def to_gridFilter(table, **kwargs): """Build the L{GridFilter} configuration for the database C{table}. The GridFilter is parametrized using the L{GridModifier}. - @type table: gluon.dal.Table - @param table: + :type table: gluon.dal.Table + :param table: - @keyword kwargs: any of the Ext JS configuration parameters of the + :keyword kwargs: any of the Ext JS configuration parameters of the C{App.grid.Filter} class. They are applied in the following order: constructor, modifiers, keyword arguments. - @rtype: GridFilter + :returns: GridFilter - @note: Return an empty dictionary if the GridFilter is + :note: Return an empty dictionary if the GridFilter is not defined in the application model. - @note: A filter rule is defined in the model via the L{GridModifier}. + :note: A filter rule is defined in the model via the L{GridModifier}. The rule is a C{tuple} containing 3 strings C{("field1", "operator", "comment")} where C{field1} is the name of a field belonging to the C{table}. @@ -485,7 +483,7 @@ def to_gridFilter(table, **kwargs): the syntax is C{("table2.field1", "operator", "comments")}. Valid operators are defined in the method L{dbsvc.DbSvc._encode_query}. - @note: Rules are store in the modifier section C{grid_filters}. + :note: Rules are store in the modifier section C{grid_filters}. """ T = current.T @@ -580,14 +578,14 @@ def to_gridPanel(table, **kwargs): """Build the L{App.grid.Panel} configuration for the database C{table}. The conversion takes into account the L{GridModifier} instructions. - @type table: gluon.dal.Table - @param table: + :type table: gluon.dal.Table + :param table: - @keyword kwargs: any of the Ext JS configuration parameters of the + :keyword kwargs: any of the Ext JS configuration parameters of the C{App.grid.Panel} class. They are applied in the following order: constructor, modifiers, keyword arguments. - @rtype: GridPanel + :returns: GridPanel """ tablename = table._tablename @@ -624,14 +622,14 @@ def to_jsonstore(table, **kwargs): """Build the L{DirectStore} configuration for the database C{table}. The conversion takes into account the L{StoreModifier} instructions. - @type table: gluon.dal.Table - @param table: + :type table: gluon.dal.Table + :param table: - @keyword kwargs: any of the Ext JS configuration parameters of the + :keyword kwargs: any of the Ext JS configuration parameters of the C{App.data.DirectStore} class. They are applied in the following order: constructor, modifiers, keyword arguments. - @rtype: DirectStore + :returns: DirectStore """ db = table._db @@ -711,10 +709,10 @@ def to_jsonstore(table, **kwargs): def to_model(table): """Build the L{Ext.data.Model} configuration for the database C{table}. - @type table: gluon.dal.Table - @param table: + :type table: gluon.dal.Table + :param table: - @rtype: dict + :returns: dict """ db = table._db @@ -759,24 +757,24 @@ def to_panelWithUrlSelector(table, selectorTitle='Select', **kwargs): """Build the L{PanelWithUrlSelector} configuration where the selector is a form derived from the database C{table}. - @type table: gluon.dal.Table - @param table: + :type table: gluon.dal.Table + :param table: - @type selectorTitle: str - @param selectorTitle: the title of the FieldSet encapsulating + :type selectorTitle: str + :param selectorTitle: the title of the FieldSet encapsulating the selector fields. - @keyword baseUrl: The selected values are send to a controller + :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 + :keyword kwargs: any of the Ext JS configuration parameters of the C{App.panel.WithUrlSelector} class. - @rtype: PanelWithUrlSelector + :returns: PanelWithUrlSelector - @raise BaseException: when baseUrl is not defined. + :raise BaseException: when baseUrl is not defined. """ if 'baseUrl' not in kwargs: @@ -802,7 +800,7 @@ def to_treeNodes(): The Node structure is defined in the application model using L{ViewportModifier}. - @rtype: list + :rtype: list """ cfg = [] @@ -821,10 +819,10 @@ def to_viewport(**kwargs): """Build the C{Ext.Viewport} configuration. The conversion takes into account the L{ViewportModifier} instructions. - @keyword kwargs: any of the Ext JS configuration parameters of the + :keyword kwargs: any of the Ext JS configuration parameters of the C{App.viewport.Viewport} class. - @rtype: dict + :returns: dict """ cfg = {} diff --git a/modules/plugin_dbui/dbsvc.py b/modules/plugin_dbui/dbsvc.py index e38fefdb8cdf5ba1588cd3e99f67630cae031695..9f6fb6f288aa513e83a81d056b4b2e4fd78b6079 100644 --- a/modules/plugin_dbui/dbsvc.py +++ b/modules/plugin_dbui/dbsvc.py @@ -1,7 +1,5 @@ """ the database service. -@author: R. Le Gac - """ import re @@ -112,8 +110,8 @@ class DbSvc(BaseSvc): """Check that the transaction data dictionary C{arg} contains the C{keywords}. - @type arg: dict - @param arg: transaction data + :type arg: dict + :param arg: transaction data - C{tableName} the name of the table in the database @@ -143,10 +141,10 @@ class DbSvc(BaseSvc): records to be deleted. - @type keywords: dict - @param keywords: list of keys which have to be in C{arg} + :type keywords: dict + :param keywords: list of keys which have to be in C{arg} - @raise DbSvcException: when a keyword is missing or when the table + :raise DbSvcException: when a keyword is missing or when the table does not exist in the database. """ @@ -162,8 +160,8 @@ class DbSvc(BaseSvc): def _encode_query(self, li): """Encode the query send by the client to a web2py C{Query}. - @type li: list - @param li: the query send by the client as a list of string. + :type li: list + :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]" @@ -175,17 +173,17 @@ class DbSvc(BaseSvc): "[table1.field1] belongs (1, 2, 3)" "([table1.field1] == [table2.field2]) | ([table1.field2] == [table2.field1])" - @rtype: tuple of gluon.dal.Query - @return: + :rtype: tuple of gluon.dal.Query + :return: - the first element is the full query with all conditions or an empty string. - the second element contains only the left join conditions or an empty string. - the third element contains only the filter conditions or an empty string. - @note: All elements of the list are ANDED in the web2py query + :note: All elements of the list are ANDED in the web2py query - @note: comparison operators are C{==, !=, <, >, <=, >=} + :note: comparison operators are C{==, !=, <, >, <=, >=} - @note: Boolean operators are C{&, |} + :note: Boolean operators are C{&, |} """ query, join, filter = "", "", "" @@ -230,14 +228,14 @@ class DbSvc(BaseSvc): def _get_record(self, table, id): """Get the record C{id} located in the database C{table}. - @type table: gluon.dal.Table - @param table: + :type table: gluon.dal.Table + :param table: - @type id: int - @param id: + :type id: int + :param id: - @rtype: dict - @return: key, value pairs where each key corresponds + :rtype: dict + :return: key, value pairs where each key corresponds to a field of the table. Foreign keys are resolved. The key are encoded as C{Table1Field1}. @@ -262,13 +260,13 @@ class DbSvc(BaseSvc): def _is_field_in_table(self, table, field): """Check that the C{field} belongs to the C{table}. - @type table: gluon.dal.Table - @param table: + :type table: gluon.dal.Table + :param table: - @type field: gluon.dal.Field - @param field: + :type field: gluon.dal.Field + :param field: - @rtype: bool + :rtype: bool """ return field in current.globalenv['db'][table].fields @@ -278,15 +276,15 @@ class DbSvc(BaseSvc): """Check each C{field} value against its C{validators}. - @type table: gluon.dal.Table - @param table: + :type table: gluon.dal.Table + :param table: - @type fields: dict - @param fields: key, value pairs where each key corresponds + :type fields: dict + :param fields: key, value pairs where each key corresponds to a C{gluon.dal.Field} - @rtype: dict - @return: key, value pairs for each field with errors. + :rtype: dict + :return: key, value pairs for each field with errors. The key is encoded as C{Table1Field1} and the value is a string describing the error message. @@ -313,12 +311,12 @@ class DbSvc(BaseSvc): def _is_table_in_db(self, tablename): """Check that the table exists in the database. - @type tablename: str - @param tablename: name of the table + :type tablename: str + :param tablename: name of the table - @raise DbSvcException: when the table does not exists + :raise DbSvcException: when the table does not exists - @note: The method works with regular and alias tables. + :note: The method works with regular and alias tables. """ db = current.globalenv['db'] @@ -338,8 +336,8 @@ class DbSvc(BaseSvc): The method also validates each value. - @type arg: dict - @param arg: transaction data + :type arg: dict + :param arg: transaction data - C{tableName} the name of the table in the database @@ -365,8 +363,8 @@ class DbSvc(BaseSvc): - The keys are encoded as C{Table1Field1}. - @rtype: gluon.storage.Storage - @return: + :rtype: gluon.storage.Storage + :return: - C{Storage(errors=[], records=[])} @@ -414,8 +412,8 @@ class DbSvc(BaseSvc): def count(self, tablename): """Count the total number of records in the table - @type tablename: string - @param tablename: name of the table + :type tablename: string + :param tablename: name of the table """ db = current.globalenv['db'] @@ -426,8 +424,8 @@ class DbSvc(BaseSvc): """Create new records defined by the transaction data C{arg}. Several transactions of the same type are processed together. - @type arg: dict - @param arg: transaction data + :type arg: dict + :param arg: transaction data - C{tableName} the name of the tablename in the database @@ -451,8 +449,8 @@ class DbSvc(BaseSvc): - The keys are encoded as C{Table1Field1}. - @rtype: dict - @return: + :rtype: dict + :return: - C{{success: True, records:[{Table1Field1: val, ... }, ... ], msg: 'blalbla'}} @@ -522,8 +520,8 @@ class DbSvc(BaseSvc): """Delete existing records defined by the transaction data C{arg}. Several transactions of the same type are processed together. - @type arg: dict - @param arg: transaction data + :type arg: dict + :param arg: transaction data - C{tableName} the name of the tablename in the database @@ -539,8 +537,8 @@ class DbSvc(BaseSvc): - C{records} the list of C{id} for the records to be deleted, C{[id1, id2, ... ]}. - @rtype: dict - @return: + :rtype: dict + :return: - C{{success: True, records:[{Table1Id1: id}, ...], msg: 'blalbla'}} @@ -601,8 +599,8 @@ class DbSvc(BaseSvc): """Read the content of a table as specified in the transaction data C{arg}. The C{arg} dictionary contains the following keys: - @type arg: dict - @param arg: transaction data + :type arg: dict + :param arg: transaction data - C{tableName} the name of the table in the database @@ -644,8 +642,8 @@ class DbSvc(BaseSvc): - sort - dir - @rtype: dict - @return: + :rtype: dict + :return: - C{{success: True, records: [{TableField: value, ...}, ...]}} @@ -729,8 +727,8 @@ class DbSvc(BaseSvc): """Update records defined by the transaction data C{arg}. Several transactions of the same type are processed together. - @type arg: dict - @param arg: transaction data + :type arg: dict + :param arg: transaction data - C{tableName} the name of the tablename in the database @@ -756,8 +754,8 @@ class DbSvc(BaseSvc): - The keys are encoded as C{Table1Field1}. - @rtype: dict - @return: + :rtype: dict + :return: - C{{success: True, records:[{Table1Field1: val, ... }, ... ], msg: 'blalbla'}} diff --git a/modules/plugin_dbui/directsvc.py b/modules/plugin_dbui/directsvc.py index 8343bb292994722415ecb7e21acdbdc409a12fe3..93831c3f136a955b2c5ea2b40f0d9c7c63b877ff 100644 --- a/modules/plugin_dbui/directsvc.py +++ b/modules/plugin_dbui/directsvc.py @@ -1,7 +1,5 @@ """ implementation of the C{Ext.Direct} protocol on the server-side. -@author: R. Le Gac - """ import datetime @@ -82,13 +80,13 @@ class DirectSvc(BaseSvc): """Check the client request and launch the execution of the function / method on the server. - @rtype: str - @return: + :rtype: str + :return: - the response of the function / method run on the server side - the response is encoded as a JSON string. - @raise gluon.http.HTTP: when the request has no arguments + :raise gluon.http.HTTP: when the request has no arguments or when the function / method crashed. """ @@ -112,13 +110,13 @@ class DirectSvc(BaseSvc): def error(self, code, message): """Build and raise the gluon.http.HTTP exception - @type code: int - @param code: code of the HTTP error + :type code: int + :param code: code of the HTTP error - @type message: str - @param message: explanation for the HTTP error + :type message: str + :param message: explanation for the HTTP error - @raise gluon.http.HTTP: + :raise gluon.http.HTTP: """ raise HTTP(code, message) @@ -134,10 +132,10 @@ class DirectSvc(BaseSvc): @service.register def myfunction(a, b): - @type f: function + :type f: function - @rtype: function - @return: f + :rtype: function + :return: f """ @@ -159,11 +157,11 @@ class DirectSvc(BaseSvc): """Route the myrequest to the appropriate function / method, pass the proper arguments and return the results. - @rtype: str - @return: the response of the function / method + :rtype: str + :return: the response of the function / method encoded as a JSON string. - @raise gluon.http.HTTP: + :raise gluon.http.HTTP: - with the code 500 when the execution of the function / method crash. - the python trace back is stored in the web2py ticket system. diff --git a/modules/plugin_dbui/extjs.py b/modules/plugin_dbui/extjs.py index 9b572a314b9bf2d569314ee09455398cdbe0b024..d1123ee8732a0af750502f16c3607fbfb17b070b 100644 --- a/modules/plugin_dbui/extjs.py +++ b/modules/plugin_dbui/extjs.py @@ -1,7 +1,5 @@ """ configurators for the Ext JS components. -@author: R. Le Gac - """ from gluon import current @@ -21,7 +19,7 @@ class Base(Storage): and C{append_plugins}. They are required to append C{items} and C{plugins}. - @note: A protection is set to avoid changing the C{xtype} of the element. + :note: A protection is set to avoid changing the C{xtype} of the element. """ xtype = None @@ -29,9 +27,9 @@ class Base(Storage): def __init__(self, **kwargs): """ - @keyword kwargs: any Ext JS configuration parameter of the target class + :keyword kwargs: any Ext JS configuration parameter of the target class - @raise ExtJSException: if the keyword C{xtype} + :raise ExtJSException: if the keyword C{xtype} is in the keyword arguments. """ @@ -130,7 +128,7 @@ class FieldSet(Base): class FieldText(Base): """Configurator for C{Ext.form.field.Text}. - @note: Regular expression for the validation can be written as a string. + :note: Regular expression for the validation can be written as a string. """ xtype = 'textfield' @@ -143,7 +141,7 @@ class FieldText(Base): class FieldTextArea(Base): """Configurator for C{Ext.form.field.TextArea}. - @note: Regular expression for the validation can be written as a string. + :note: Regular expression for the validation can be written as a string. """ xtype = 'textarea' @@ -170,7 +168,7 @@ class GridColumn(dict): class GridColumnModel(list): """Configurator for C{Ext.grid.ColumnModel}. - @note:It is implemented as a C{list} of L{GridColumn}. + :note:It is implemented as a C{list} of L{GridColumn}. """ diff --git a/modules/plugin_dbui/fieldsmodifier.py b/modules/plugin_dbui/fieldsmodifier.py index c63a1e6310053a9736574b277f4fe4ef6ab70b4e..2a8fcd172d8c0292b0ad9c7fcb5fbcf031fd2758 100644 --- a/modules/plugin_dbui/fieldsmodifier.py +++ b/modules/plugin_dbui/fieldsmodifier.py @@ -1,7 +1,5 @@ """ the fields modifier -@author: R. Le Gac - """ from gluon.storage import Storage @@ -42,8 +40,8 @@ class FieldsModifier(Modifier): - There is one to one correspondence between the C{composite_fields.main} and the C{composite_fields.others} lists. - @type tablename: str - @param tablename: name of the database table + :type tablename: str + :param tablename: name of the database table """ Modifier.__init__(self, MODIFIER_FIELDS, tablename) @@ -76,8 +74,8 @@ class FieldsModifier(Modifier): Existing value of the configuration options are replace by those defined by the keyword arguments. - @type field: str - @param field: name of the database field. + :type field: str + :param field: name of the database field. It should belong to the database table defined in the constructor. """ @@ -97,7 +95,7 @@ class FieldsModifier(Modifier): They can be super seed by the keyword arguments. - @note: + :note: - Each C{field} is identified by its database field name. - C{field} should belong to the database table defined in the constructor. - The first C{field} is the main field of the C{FieldContainer}. diff --git a/modules/plugin_dbui/filters.py b/modules/plugin_dbui/filters.py index 232943fb07c17ece6d2a5d9cb5c06f63921282b7..d9f19bea827735b73cf96f93c02ab9f3ac94b350 100644 --- a/modules/plugin_dbui/filters.py +++ b/modules/plugin_dbui/filters.py @@ -1,7 +1,5 @@ """ a collection of filters -@author: R. Le Gac - """ import re @@ -11,12 +9,12 @@ def CLEAN_COMMA(value): """Remove trailing comma(s). Search patterns are: ',' or ', ' or ' ,, ' ... - @type value: str or unicode - @param value: + :type value: str or unicode + :param value: - @rtype: str or unicode + :rtype: str or unicode - @note: return the value unchanged when it is not a string. + :note: return the value unchanged when it is not a string. """ if not isinstance(value, (str, unicode)): @@ -29,12 +27,12 @@ def CLEAN_SPACES(value): """Remove leading as well as trailing spaces and keep a single space between words. - @type value: str or unicode - @param value: + :type value: str or unicode + :param value: - @rtype: str or unicode + :rtype: str or unicode - @note: return the value unchanged when it is not a string. + :note: return the value unchanged when it is not a string. """ if not isinstance(value, (str, unicode)): diff --git a/modules/plugin_dbui/formmodifier.py b/modules/plugin_dbui/formmodifier.py index e5fe317fe034331ad27df7d41b094f1894e92935..f6630ce5988c2e7e6715f5d9ea5e55641455a7cd 100644 --- a/modules/plugin_dbui/formmodifier.py +++ b/modules/plugin_dbui/formmodifier.py @@ -1,7 +1,5 @@ """ the form modifier -@author: R. Le Gac - """ import copy @@ -23,11 +21,11 @@ def configure_forms(db, **extjs): """Apply to all form widgets the same configuration options. 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 + :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. - @note: The keyword arguments define values for the Ext JS configuration + :note: The keyword arguments define values for the Ext JS configuration options of he C{Ext.form.Panel} class. """ @@ -77,8 +75,8 @@ class FormModifier(Modifier): - C{mapper} (None or function) reference to the function used to organize the C{FieldSet} in C{Tabs}, for example. - @type tablename: str - @param tablename: name of the database table + :type tablename: str + :param tablename: name of the database table """ Modifier.__init__(self, MODIFIER_FORMS, tablename) @@ -111,28 +109,28 @@ 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. + :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 C{masterHasSlaveData} table. - @type slave: gluon.dal.Field - @keyword slave: the field used as salve. + :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 C{masterHasSlaveData} table. - @type masterHasSlaveData: str - @keyword masterHasSlaveData: name of the external database 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 + :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 + :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. diff --git a/modules/plugin_dbui/gridmodifier.py b/modules/plugin_dbui/gridmodifier.py index 5eb92ea6180d7b027ba5caa6cca2593d2ee6ed47..6e89f8f99930dc1febb11633b67c02febf0b2c75 100644 --- a/modules/plugin_dbui/gridmodifier.py +++ b/modules/plugin_dbui/gridmodifier.py @@ -1,7 +1,5 @@ """the grid modifier. -@author: R. Le Gac - """ import copy @@ -25,8 +23,8 @@ def configure_grids(db, **extjs): """Apply to all grid widgets the same configuration options. 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 + :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. The keyword arguments contain the configuration options for @@ -83,8 +81,8 @@ class GridModifier(Modifier): - C{template_columns} (list - @type tablename: str - @param tablename: name of the database table + :type tablename: str + :param tablename: name of the database table """ Modifier.__init__(self, MODIFIER_GRIDS, tablename) @@ -124,8 +122,8 @@ class GridModifier(Modifier): located on the right side of the GridPanel. A filter corresponds to a field in the FieldSet. - @type filter: tuple - @param filter: A filter is defined by a tuple containing three strings: + :type filter: tuple + :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, C{'table2.field1'}, @@ -148,8 +146,8 @@ class GridModifier(Modifier): This method is useful to fine tune column width for example. - @type fieldname: str - @param fieldname: name of a database field. + :type fieldname: str + :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 @@ -205,9 +203,9 @@ class GridModifier(Modifier): The TemplateColumn is rendered by the C{Ext.grid.TemplateColumn}. Each field is identified by its database field name. - @keyword header: (str) the header of the TemplateColumn + :keyword header: (str) the header of the TemplateColumn - @keyword tpl: (list) the template defining how fields are displayed + :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 C{Ext.XTemplate} constructor. @@ -222,14 +220,14 @@ class GridModifier(Modifier): '{PeopleFirst_name}<br>', '<tpl if={PeoplePhone_number}>{PeoplePhone_number}</tpl>'] - @keyword autohide: (bool) hide the columns associated to the fields + :keyword autohide: (bool) hide the columns associated to the fields used in the TemplateColumn when set to C{True}. - @keyword position: (int) is a number defining where the + :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 + :keyword extjs: (dict) contains the Ext JS configuration options of the C{Ext.grid.TemplateColumn}. """ @@ -262,7 +260,7 @@ class GridModifier(Modifier): By default it is activate for all grids. - @type bool: boolean - @param bool: activate the row numbering when C{True}. + :type bool: boolean + :param bool: activate the row numbering when C{True}. """ self.data.row_numbering = bool diff --git a/modules/plugin_dbui/helper.py b/modules/plugin_dbui/helper.py index e3de60d6332e14c72ae63c55d0593c34db6fad96..29b40e15a96cd98f1d5ad3b73ed0973f78e98134 100644 --- a/modules/plugin_dbui/helper.py +++ b/modules/plugin_dbui/helper.py @@ -1,7 +1,5 @@ """ a series of helper functions -@author: R. Le Gac - """ import os @@ -31,10 +29,10 @@ def as_list(val): """Encapsulated C{val} into a C{list} when C{val} is not an instance of a C{list}. - @type val: any - @param val: input value + :type val: any + :param val: input value - @rtype: list + :rtype: list """ if not isinstance(val, (list, tuple)): @@ -63,12 +61,12 @@ def decode_field(field): of words where all words are in lower case. The reverse function is L{encode_field}. - @note: useful to decode database field name: + :note: useful to decode database field name: C{"TableField"} or C{"TableFieldFunction"} - @type field: str + :type field: str - @rtype: tuple + :rtype: tuple """ li = [] @@ -90,13 +88,13 @@ def dummy_row(table, value=''): empty_row = dummy_row(db.table) row.records.append(row) - @type table: gluon.dal.Table - @param table: + :type table: gluon.dal.Table + :param table: - @type value: string - @param value: value associated to each field either an empty string of None + :type value: string + :param value: value associated to each field either an empty string of None - @rtype: gluon.dal.Row + :rtype: gluon.dal.Row """ db = table._db @@ -122,12 +120,12 @@ def encode_field(*args): """Encode the string arguments into a CapitalizeWords. The reverse function is L{decode_field}. - @rtype: str + :rtype: str - @note: useful to build database field name like C{TableField} + :note: useful to build database field name like C{TableField} or C{TableFieldFunc}. - @note: The Ext JS ComboBox don't decode properly any separator between + :note: The Ext JS ComboBox don't decode properly any separator between table and field like table+field. Therefore choice for the encoding are very limited. @@ -140,12 +138,12 @@ def encode_field(*args): 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] + :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 - @rtype: dict - @return: error message are translated and should be more friendly + :rtype: dict + :return: error message are translated and should be more friendly since it contains the field name with its error. """ @@ -160,12 +158,12 @@ def get_all_tables(dal): """Get the list of names for all tables in the database, C{dal}, including alias table. - @type dal: gluon.dal.DAL - @param dal: + :type dal: gluon.dal.DAL + :param dal: - @rtype: list + :rtype: list - @note: It is recommend to use standard iterator provided by + :note: It is recommend to use standard iterator provided by the gluon.dal.DAL class. However by construction, they ignore alias table. @@ -184,10 +182,10 @@ def get_create_id(table, **kwargs): id = get_create_id(db.person, first_name="Joe", last_name="Doe") - @type table: gluon.dal.Table + :type table: gluon.dal.Table - @rtype: int - @return: the C{id} of the record. + :rtype: int + :return: the C{id} of the record. """ id = get_id(table, **kwargs) @@ -202,10 +200,10 @@ def get_field_validators(field): """Get the Ext JS configuration parameters to run database gluon.dal.Field validators on the client-side. - @type field: gluon.dal.Field + :type field: gluon.dal.Field - @rtype: dict - @return: The keys depend on the validators. + :rtype: dict + :return: The keys depend on the validators. Typical one are C{minValue}, C{maxValue}, C{regex}, C{regexText}, C{maxLength}, C{minLength}, ... @@ -258,8 +256,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: + :type path: None, list or string + :param path: local path defining the target files: - C{None}. @@ -272,15 +270,15 @@ def get_file_paths(path, ext=None, alpha=True): - a C{list} of string pointing to files and directory. - @type ext: str - @param ext: select only files with the extension C{ext}, I{i.e} + :type ext: str + :param ext: select only files with the extension C{ext}, I{i.e} C{.js}, C{.css}, ... - @type alpha: bool - @param alpha: sort the paths in alphabetic order + :type alpha: bool + :param alpha: sort the paths in alphabetic order - @rtype: list - @return: local paths for all selected files. + :rtype: list + :return: local paths for all selected files. """ li = [] @@ -311,10 +309,10 @@ def get_foreign_field(field): """Get a tuple with the reference table name, reference field name and reference primary key name, for the C{field}. - @type field: gluon.dal.Field + :type field: gluon.dal.Field - @rtype: tuple - @return: + :rtype: tuple + :return: - C{(k_tablename, k_fieldname, k_keyname)} @@ -370,10 +368,10 @@ def get_id(table, **kwargs): """Get the C{id} of the record identified by a set of C{field=value} keyword arguments. Return C{None} if the record does not exist. - @type table: gluon.dal.Table + :type table: gluon.dal.Table - @rtype: int or None - @return: the C{id} of the record. + :rtype: int or None + :return: the C{id} of the record. """ query = None @@ -396,8 +394,8 @@ def get_language(): """Get the primary language of the application from the HTML language code, I{i.e} C{en}, C{fr}, .... - @rtype: str - @return: + :rtype: str + :return: """ lg = current.T.accepted_language @@ -414,11 +412,11 @@ def get_language(): def get_plugin_path(plugin_name): """Get the local path of the plugin identified by its name. - @type plugin_name: str - @param plugin_name: name of the plugin, I{i.e} C{"plugin_dbui"}. + :type plugin_name: str + :param plugin_name: name of the plugin, I{i.e} C{"plugin_dbui"}. - @rtype: str - @return: + :rtype: str + :return: - the path of the first directory starting with C{plugin_name}. - the local path is relative to the application directory. - C{None} if the plugin is not found. @@ -445,8 +443,8 @@ def get_reference_paths(): - The local path is relative to the applications directory. It is useful on the client-side - @rtype: tuple - @return: C{("applications/myapp", "/myapp")} + :rtype: tuple + :return: C{("applications/myapp", "/myapp")} """ server_path = os.path.join('applications', current.request.application) @@ -458,10 +456,10 @@ def get_reference_paths(): def get_set_field(field): """Get the list of the set data for the C{field} when defines. - @type field: gluon.dal.Field - @param field: + :type field: gluon.dal.Field + :param field: - @rtype: list + :rtype: list """ validators = as_list(field.requires) @@ -498,11 +496,11 @@ def get_script_path(plugin): - the script path is defined by the C{plugin_dbui} configuration parameters C{app_script}. - @type plugin: plugin instance - @param plugin: + :type plugin: plugin instance + :param plugin: - @rtype: str - @return: + :rtype: str + :return: - the local path of the script file - the local paths is relative to the application directory. @@ -534,9 +532,9 @@ def get_script_path(plugin): def get_store_id(name): """Build the store identifier using C{name}. - @type name: str - @rtype: str - @return: C{nameStore} + :type name: str + :rtype: str + :return: C{nameStore} """ return STOREID % name @@ -545,8 +543,8 @@ def get_store_id(name): def get_versions(): """Get the versions of the application and plugins. - @rtype: list of dict - @return: each dictionary contains the name of the software + :rtype: list of dict + :return: each dictionary contains the name of the software and its version identifier. The keys are C{code} and C{version} """ @@ -643,11 +641,11 @@ def get_where_query(table): """Build the L{gluon.dal.Query} resolving foreign keys for the C{table}. - @type table: gluon.dal.Table - @param table: + :type table: gluon.dal.Table + :param table: - @rtype: gluon.dal.Query or None - @return: C{None} when the table has no foreign key + :rtype: gluon.dal.Query or None + :return: C{None} when the table has no foreign key """ db = table._db @@ -671,10 +669,10 @@ def get_where_query(table): def is_foreign_field(field): """Return C{True} when the C{field} is a reference field. - @type field: gluon.dal.Field - @param field: + :type field: gluon.dal.Field + :param field: - @rtype: bool + :rtype: bool """ return field.type.startswith("reference") @@ -683,8 +681,8 @@ def is_foreign_field(field): def is_mathjax(): """Return C{True} when the plugin mathjax is installed. - @rtype: bool - @return: + :rtype: bool + :return: """ return get_plugin_path('plugin_mathjax') != None @@ -694,9 +692,9 @@ def is_set_field(field): """Return C{True} when the C{field} value should matches those of a C{set}. - @type field: gluon.dal.Field + :type field: gluon.dal.Field - @rtype: bool + :rtype: bool """ validators = as_list(field.requires) @@ -712,9 +710,9 @@ def is_table_with_foreign_fields(table): """Return C{True} when the database C{table} has at least one reference field. - @type table: gluon.dal.Table + :type table: gluon.dal.Table - @rtype: bool + :rtype: bool """ for field in table: @@ -728,9 +726,9 @@ def rows_serializer(rows): It handle the general case where field belongs to different table and where function are applied. - @type rows: gluon.dal.Rows - @rtype: list - @return: + :type rows: gluon.dal.Rows + :rtype: list + :return: - C{[{Table1Field1: val1,...}, {Table1Field1: val2,...}, ...]} - A dictionary per row. - Field are encoded as TableField. diff --git a/modules/plugin_dbui/mapper.py b/modules/plugin_dbui/mapper.py index 5bf90337e990337c4e8e6ae6dffce29f11c6bc71..4a95a49048c39f3812b985638ba3db98ab9c4d5f 100644 --- a/modules/plugin_dbui/mapper.py +++ b/modules/plugin_dbui/mapper.py @@ -1,7 +1,5 @@ """ the collections of mapper functions. -@author: R. Le Gac - """ from extjs import TabPanel @@ -9,11 +7,11 @@ from extjs import TabPanel def map_default(fields): """Map a list of field in the C{Ext.form.formPanel}. - @type fields: list - @param fields: list of database field names + :type fields: list + :param fields: list of database field names - @rtype: list - @return: the input list + :rtype: list + :return: the input list """ return fields @@ -25,10 +23,10 @@ def map_tabpanel(fieldsets): - A tab is associated to each fieldset. - the name of the tab is the name of the fieldset. - @type fieldsets: list of FieldSet + :type fieldsets: list of FieldSet - @rtype: list - @return: the C{TapPanel} encapsulated in a list. + :rtype: list + :return: the C{TapPanel} encapsulated in a list. """ diff --git a/modules/plugin_dbui/modifier.py b/modules/plugin_dbui/modifier.py index fe876173ab815058f3ab99a8a661268fc536b631..7bd6dd7c32f09f58ad7706f7d4828a11e05ca186 100644 --- a/modules/plugin_dbui/modifier.py +++ b/modules/plugin_dbui/modifier.py @@ -1,7 +1,5 @@ """ the modifier class -@author: R. Le Gac - """ from gluon import current from gluon.storage import Storage @@ -37,11 +35,11 @@ class Modifier(object): - The C{Storage} contains the C{extjs} key to store configuration parameter of the associate Ext JS widget. - @type dpname: str - @param dpname: name of the data point. + :type dpname: str + :param dpname: name of the data point. - @type tablename: str - @param tablename: name of the database table. + :type tablename: str + :param tablename: name of the database table. """ p = PluginManager('dbui') @@ -65,7 +63,7 @@ class Modifier(object): def configure(self, **extjs): """Set the configuration parameters for the associated Ext JS widget. - @note: + :note: - Existing value of the configuration parameters are replaced by those defined in the keyword arguments. diff --git a/modules/plugin_dbui/navtree.py b/modules/plugin_dbui/navtree.py index 7531ea8d7401e60bfb3cd834d7723198bc0ec0c8..a5c8c2158ea1a87b971a394ce32371422da5fa66 100644 --- a/modules/plugin_dbui/navtree.py +++ b/modules/plugin_dbui/navtree.py @@ -1,7 +1,5 @@ """ the C{Node} class to build navigation tree. -@author: R. Le Gac - """ import locale @@ -17,8 +15,8 @@ class Node(object): def __init__(self, text): """Construct the node. - @type text: str - @param text: name of the node appearing in the viewport + :type text: str + :param text: name of the node appearing in the viewport """ self.text = text @@ -29,11 +27,11 @@ class Node(object): def add_child(self, text, cfg): """Add a child (leaf) to the node. - @type text: str - @param text: the name of the leaf + :type text: str + :param text: the name of the leaf - @type cfg: dict - @param cfg: the Ext JS configuration options defining the widget + :type cfg: dict + :param cfg: the Ext JS configuration options defining the widget associated to the leaf """ @@ -44,18 +42,18 @@ class Node(object): def add_children(self, leaves, func=None, hidden=[]): """Add children (leaves) to the node. - @type leaves: list - @param leaves: a list of string + :type leaves: list + :param leaves: a list of string - @type func: function - @param func: function translating the leaf name into + :type func: function + :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. + :type hidden: list + :param hidden: List of children to be hidden. - @note: + :note: - Leaf names are translated in the current language - Leaf names are sorted in alphabetic order @@ -84,8 +82,8 @@ class Node(object): def get_node(self): """Get the dictionary defining the node. - @rtype: dict - @return: + :rtype: dict + :return: - C{text} (str): name of the node diff --git a/modules/plugin_dbui/selector.py b/modules/plugin_dbui/selector.py index a5d3216f664cd863dcb295673837d8698279935d..ffe4284afd0b8e475ff4cd63ebdc8331bb6fa978 100644 --- a/modules/plugin_dbui/selector.py +++ b/modules/plugin_dbui/selector.py @@ -54,11 +54,11 @@ class Selector(Storage): def __init__(self, table, exclude_fields=()): """ - @type table: gluon.dal.Table - @param table: the table containing the definition of the selector + :type table: gluon.dal.Table + :param table: the table containing the definition of the selector - @type exclude_fields: tuple - @param exclude_fields: a list of selector field names + :type exclude_fields: tuple + :param exclude_fields: a list of selector field names which have to be ignored in query and select operations. """ @@ -117,7 +117,7 @@ class Selector(Storage): """Add constraints which will be used in the database query and database select operations. - @type query: gluon.dal.Query + :type query: gluon.dal.Query """ self._extra_queries.append(query) @@ -126,8 +126,8 @@ class Selector(Storage): def as_dict(self): """Return the selector fields and their values. - @rtype: dict - @return: + :rtype: dict + :return: """ di = {} @@ -139,8 +139,8 @@ class Selector(Storage): def fields(self): """Get the list of field names defined in the selector. - @rtype: list - @return: + :rtype: list + :return: """ li = [] @@ -159,9 +159,9 @@ class Selector(Storage): - the C{extfield} as well as fields in the C{exclude_fields} tuple are not take into account in the query. - @type table: gluon.dal.Table + :type table: gluon.dal.Table - @rtype: gluon.dal.Query + :rtype: gluon.dal.Query """ db = table._db @@ -202,8 +202,8 @@ class Selector(Storage): def repr_url(self): """Get the URL string corresponding to the current request. - @rtype: str - @return: + :rtype: str + :return: """ vars = [] @@ -232,16 +232,16 @@ class Selector(Storage): - It returns Rows which contains reference tables and columns. - @type table: gluon.dal.Table + :type table: gluon.dal.Table - @param args: + :param args: field with operator (avg, count, max, min and sum) - @param kwargs: + :param kwargs: The keyword arguments are those of the gluon.dal.Set.select method: orderby, groupby, .... - @rtype: gluon.dal.Rows + :rtype: gluon.dal.Rows """ db = table._db diff --git a/modules/plugin_dbui/storemodifier.py b/modules/plugin_dbui/storemodifier.py index 17c6e7e6c796660ad2686d09119ddc8dadbdf8ee..6f3dbb81e5e4f0f72d46843e7f9a06627ff1418d 100644 --- a/modules/plugin_dbui/storemodifier.py +++ b/modules/plugin_dbui/storemodifier.py @@ -1,7 +1,5 @@ """ the store modifier. -@author: R. Le Gac - """ from gluon.storage import Storage @@ -35,15 +33,15 @@ class AddStore(object): def __init__(self, name, **kwargs): """ Create the configuration option of an Ext JS Store. - @type name: str - @param name: name for the store + :type name: str + :param name: name for the store The keyword arguments contains the configuration options for the store. For an C{Ext.data.ArrayStore} the keyword C{fields} and C{data} have to be defined. For more details see the ExtJS documentation. - @note: + :note: The key associated to this store in the persistent dictionary is the C{storeId}. Its value is derived from the store name, I{i.e} C{nameStore}. @@ -80,8 +78,8 @@ class StoreModifier(Modifier): - C{order_by} (list of gluon.dal.Field) list of fields to order the content of the store - @type tablename: str - @param tablename: name of the database table + :type tablename: str + :param tablename: name of the database table """ Modifier.__init__(self, MODIFIER_STORES, tablename) @@ -114,7 +112,7 @@ 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 C{Ext.data.Store}. + :param kwargs: Any configuration parameter of the C{Ext.data.Store}. Those related to the buffering are C{buffered}, C{clearOnPaqgeLoad}, C{leadingBufferZone}, C{pageSize}, C{purgePageCount} and C{trailingBufferZone}. diff --git a/modules/plugin_dbui/validator.py b/modules/plugin_dbui/validator.py index f458a637526be8545d5057d0ef3ff9e8f090b862..5f296d22df82dc595bfb59fc785308f8e0ee6966 100644 --- a/modules/plugin_dbui/validator.py +++ b/modules/plugin_dbui/validator.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ validator -@author: R. Le Gac - """ from gluon.validators import IS_IN_SET diff --git a/modules/plugin_dbui/viewportmodifier.py b/modules/plugin_dbui/viewportmodifier.py index d31d107f61248061399bc793af7d65df72355cd2..bfbc40571e86f19652a96a336430cf916e769c62 100644 --- a/modules/plugin_dbui/viewportmodifier.py +++ b/modules/plugin_dbui/viewportmodifier.py @@ -1,7 +1,5 @@ """ the viewport modifier. -@author: R. Le Gac - """ from gluon.storage import Storage @@ -53,13 +51,13 @@ class ViewportModifier(Modifier): def add_node(self, *args): """Add a list of L{Node}s to the navigation tree. - @type args: list of L{Node} - @param args: + :type args: list of L{Node} + :param args: - @note: Elements of the list equal to C{None} are ignored. + :note: Elements of the list equal to C{None} are ignored. This feature is useful when the list of nodes depend on user role. - @raise ViewportModifierException: at least one element of the list + :raise ViewportModifierException: at least one element of the list is not a C{Node} or C{None}. """ @@ -81,8 +79,8 @@ class ViewportModifier(Modifier): def default_node(self, *args): """Defined the node which will be opened at start up. - @type args: list of nodes identified by their C{text} string. - @param args: define the path of the node + :type args: list of nodes identified by their C{text} string. + :param args: define the path of the node """ self.data.default = args