diff --git a/modules/plugin_dbui/converter.py b/modules/plugin_dbui/converter.py index b9b27195509b39a30592570104bcd089c2aef2dc..11d8b8885c58a249481322fb43c664ea47e1f3a7 100644 --- a/modules/plugin_dbui/converter.py +++ b/modules/plugin_dbui/converter.py @@ -67,13 +67,15 @@ def _to_field(field, linkedcombo=True, **kwargs): :returns: Field - :note: The return configurator is a L{Field}. However it can be a - L{ComboBox}, a L{FieldDate}, a L{FieldTextArea}, ... - depending on the ``type`` of the database field. - The association is defined in the dictionary L{FTYPE_TO_XTYPE}. + :note: + The return configurator is a L{Field}. However it can be a + L{ComboBox}, a L{FieldDate}, a L{FieldTextArea}, ... + depending on the ``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} - which also understands ``FieldContainer``. + :attention: + It is recommended to used the more general method L{to_field} + which also understands ``FieldContainer``. """ T = current.T @@ -174,13 +176,15 @@ def to_field(field, composite=True, linkedcombo=True, **kwargs): The conversion handles L{FieldContainer} and takes into account the ``FieldsModifier`` instructions. - :note: The return configurator is a L{Field}. However it can be a - L{ComboBox}, a L{FieldDate}, a L{FieldTextArea}, ... - depending on the ``type`` of the database field. - The association is defined in the dictionary L{FTYPE_TO_XTYPE}. + :note: + The return configurator is a L{Field}. However it can be a + L{ComboBox}, a L{FieldDate}, a L{FieldTextArea}, ... + depending on the ``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} - in the application model using the modifiers L{FieldsModifier}. + :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: @@ -202,8 +206,9 @@ def to_field(field, composite=True, linkedcombo=True, **kwargs): :returns: Field or ``None`` - :note: Return None when composite is ``True`` and when - the field is consumed by a ``FieldContainer``. + :note: + Return None when composite is ``True`` and when + the field is consumed by a ``FieldContainer``. """ table = field.table @@ -247,16 +252,18 @@ def to_fields(table): """Build the list L{Field} configuration for each field of the database ``table``. - :note: The return configuration is a L{Field}. However it can be a - L{ComboBox}, a L{FieldDate}, a L{FieldTextArea}, ... - depending on the ``type`` of the database field. - The association is defined in the dictionary L{FTYPE_TO_XTYPE}. + :note: + The return configuration is a L{Field}. However it can be a + L{ComboBox}, a L{FieldDate}, a L{FieldTextArea}, ... + depending on the ``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} - as well as the L{FieldsModifier} instructions. - The ``FieldSet`` and ``FieldContainer`` can be defined in the application - model using the modifier L{FormModifier} and the L{FieldsModifier} - respectively. + :note: + The function handles L{FieldSet} and L{FieldContainer} + as well as the L{FieldsModifier} instructions. + The ``FieldSet`` and ``FieldContainer`` can be defined in the application + model using the modifier L{FormModifier} and the L{FieldsModifier} + respectively. :type table: gluon.dal.Table :returns: list @@ -480,18 +487,21 @@ def to_gridFilter(table, **kwargs): :returns: GridFilter - :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}. - The rule is a ``tuple`` containing 3 strings - ``("field1", "operator", "comment")`` - where ``field1`` is the name of a field belonging to the ``table``. - A more elaborate filter rule allows to filter on any foreign field using - the syntax is ``("table2.field1", "operator", "comments")``. - Valid operators are defined in the method L{dbsvc.DbSvc._encode_query}. - - :note: Rules are store in the modifier section ``grid_filters``. + :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}. + The rule is a ``tuple`` containing 3 strings + ``("field1", "operator", "comment")`` + where ``field1`` is the name of a field belonging to the ``table``. + A more elaborate filter rule allows to filter on any foreign field using + the syntax is ``("table2.field1", "operator", "comments")``. + Valid operators are defined in the method L{dbsvc.DbSvc._encode_query}. + + :note: + Rules are store in the modifier section ``grid_filters``. """ T = current.T diff --git a/modules/plugin_dbui/dbsvc.py b/modules/plugin_dbui/dbsvc.py index 155c84a784179a29fe77491e25f57cd8a31fb047..2c5a1417b63993eb05a2f70032266f02249b71e1 100644 --- a/modules/plugin_dbui/dbsvc.py +++ b/modules/plugin_dbui/dbsvc.py @@ -145,8 +145,9 @@ class DbSvc(BaseSvc): :type keywords: dict :param keywords: list of keys which have to be in ``arg`` - :raise DbSvcException: when a keyword is missing or when the table - does not exist in the database. + :raise DbSvcException: + when a keyword is missing or when the table + does not exist in the database. """ # check that the request is well formed diff --git a/modules/plugin_dbui/directsvc.py b/modules/plugin_dbui/directsvc.py index 1034673b7acd7deb917ecf28096440439d17aaad..94e1a726aeb499a4841e516047cce5599aa581e1 100644 --- a/modules/plugin_dbui/directsvc.py +++ b/modules/plugin_dbui/directsvc.py @@ -82,13 +82,14 @@ class DirectSvc(BaseSvc): :rtype: str :returns: - str --: + str - - the response of the function / method run - on the server side - - the response is encoded as a JSON string. + - 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. """ @@ -204,5 +205,3 @@ class DirectSvc(BaseSvc): self.dbg('End directSvc.call', li) return json.dumps(li, cls=MyJsonEncoder) - - \ No newline at end of file diff --git a/modules/plugin_dbui/formmodifier.py b/modules/plugin_dbui/formmodifier.py index 952314115cfc09ee4268a827d0a4447096255b6f..708c457667c90ce88fc89836ebd4b69f6046756c 100644 --- a/modules/plugin_dbui/formmodifier.py +++ b/modules/plugin_dbui/formmodifier.py @@ -26,8 +26,9 @@ def configure_forms(db, **extjs): 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. + :note: + The keyword arguments define values for the Ext JS configuration + options of he ``Ext.form.Panel`` class. """ if isinstance(db, DAL): diff --git a/modules/plugin_dbui/gridmodifier.py b/modules/plugin_dbui/gridmodifier.py index fb4ecdb865985e60b3be8069ed4d7d5006ba3d92..428eb15982b0f06cb6d128f3df3b8bb82f1fd6e9 100644 --- a/modules/plugin_dbui/gridmodifier.py +++ b/modules/plugin_dbui/gridmodifier.py @@ -271,5 +271,6 @@ class GridModifier(Modifier): :type bool: boolean :param bool: activate the row numbering when ``True``. + """ self.data.row_numbering = bool diff --git a/modules/plugin_dbui/helper.py b/modules/plugin_dbui/helper.py index 0ab8dbf47859d838dcd941daba4c52335cc6279f..b3f2fba97985fff4abd1aa636bdfd126661e8558 100644 --- a/modules/plugin_dbui/helper.py +++ b/modules/plugin_dbui/helper.py @@ -122,12 +122,14 @@ def encode_field(*args): :returns: str - :note: useful to build database field name like ``TableField`` - or ``TableFieldFunc``. + :note: + useful to build database field name like ``TableField`` + or ``TableFieldFunc``. - :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. + :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. """ # NOTE: don't use the method title since foo_faa @@ -164,7 +166,8 @@ def get_all_tables(dal): :returns: 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. diff --git a/modules/plugin_dbui/storemodifier.py b/modules/plugin_dbui/storemodifier.py index ce3cee50099f53bd3cfafc1e92cc7f3a47f13c90..8cb677a68c9c327df729131d2a91f0c95ac597a6 100644 --- a/modules/plugin_dbui/storemodifier.py +++ b/modules/plugin_dbui/storemodifier.py @@ -42,9 +42,9 @@ class AddStore(object): have to be defined. For more details see the ExtJS documentation. :note: - The key associated to this store in the persistent dictionary - is the ``storeId``. Its value is derived from the store name, - I{i.e} ``nameStore``. + The key associated to this store in the persistent dictionary + is the ``storeId``. Its value is derived from the store name, + I{i.e} ``nameStore``. """ static_stores = PluginManager('dbui').dbui.static_stores diff --git a/modules/plugin_dbui/viewportmodifier.py b/modules/plugin_dbui/viewportmodifier.py index acefb6e99e0ea7b559985204b67a1177fc236ea5..5cdcef05191957c20f149007427852675a4c9623 100644 --- a/modules/plugin_dbui/viewportmodifier.py +++ b/modules/plugin_dbui/viewportmodifier.py @@ -54,11 +54,13 @@ class ViewportModifier(Modifier): :type args: list of L{Node} :param args: - :note: Elements of the list equal to ``None`` are ignored. - This feature is useful when the list of nodes depend on user role. + :note: + Elements of the list equal to ``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 - is not a ``Node`` or ``None``. + :raise ViewportModifierException: + at least one element of the list + is not a ``Node`` or ``None``. """ li = []