Commit 496d8305 authored by legac's avatar legac
Browse files

Replace C{..} by ....

parent 94c352be
......@@ -48,30 +48,30 @@ X_LINKED_COMBO = ['xcomboboxmaster', 'xcomboboxslave']
def _to_field(field, linkedcombo=True, **kwargs):
"""Build the L{Field} configuration associated to the database C{field}.
"""Build the L{Field} configuration associated to the database ``field``.
The conversion takes into account the L{FieldsModifier} instructions
but does not handle C{FieldContainer}.
but does not handle ``FieldContainer``.
:param field:
:type field: gluon.dal.Field
:type linkedcombo: bool
:param linkedcombo: C{LinkedComboBox} are ignored when C{False}.
:param linkedcombo: ``LinkedComboBox`` are ignored when ``False``.
Useful to build grid filter.
:keyword kwargs: any Ext JS configuration parameters of the
C{Ext.form.Field} class. They are applied in the following order:
``Ext.form.Field`` class. They are applied in the following order:
constructor, modifiers and keyword arguments.
: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 C{type} of the database field.
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 C{FieldContainer}.
which also understands ``FieldContainer``.
"""
T = current.T
......@@ -170,11 +170,11 @@ def _to_field(field, linkedcombo=True, **kwargs):
def to_field(field, composite=True, linkedcombo=True, **kwargs):
"""Build the L{Field} configuration for the database field.
The conversion handles L{FieldContainer} and takes into account
the C{FieldsModifier} instructions.
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 C{type} of the database field.
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}
......@@ -184,21 +184,21 @@ def to_field(field, composite=True, linkedcombo=True, **kwargs):
:param field:
:type composite: bool
:param composite: C{FieldContainer} is ignored when C{False}.
:param composite: ``FieldContainer`` is ignored when ``False``.
Useful to build grid filter.
:type linkedcombo: bool
:param linkedcombo: C{LinkedComboBox} are ignored when C{False}.
:param linkedcombo: ``LinkedComboBox`` are ignored when ``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 ``Ext.form.Field``
class. They are applied in the following order:
constructor, modifiers and keyword arguments.
:returns: Field or C{None}
:returns: Field or ``None``
:note: Return None when composite is C{True} and when
the field is consumed by a C{FieldContainer}.
:note: Return None when composite is ``True`` and when
the field is consumed by a ``FieldContainer``.
"""
table = field.table
......@@ -240,16 +240,16 @@ def to_field(field, composite=True, linkedcombo=True, **kwargs):
def to_fields(table):
"""Build the list L{Field} configuration for each field
of the database C{table}.
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 C{type} of the database field.
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 C{FieldSet} and C{FieldContainer} can be defined in the application
The ``FieldSet`` and ``FieldContainer`` can be defined in the application
model using the modifier L{FormModifier} and the L{FieldsModifier}
respectively.
......@@ -320,14 +320,14 @@ def to_fields(table):
def to_formPanel(table, **kwargs):
"""Build the L{FormPanel} configuration for the database C{table}.
"""Build the L{FormPanel} configuration for the database ``table``.
The conversion takes into account the L{FormModifier} instructions.
:type table: gluon.dal.Table
:param table:
:param kwargs: any Ext JS configuration parameter of the
C{Ext.form.Panel} class. They are
``Ext.form.Panel`` class. They are
applied in the following order: constructor, modifiers
and keyword arguments.
......@@ -355,14 +355,14 @@ def to_formPanel(table, **kwargs):
def to_gridColumn(field, **kwargs):
"""Build the L{GridColumn} configuration for the database C{field}.
"""Build the L{GridColumn} configuration for the database ``field``.
The conversion takes into account the L{GridModifier} instructions.
:type field: gluon.dal.Field
:param field:
:param kwargs: any Ext JS configuration parameter of the
C{Ext.grid.Column} class.
``Ext.grid.Column`` class.
They are applied in the following order: constructor, modifiers
and keyword arguments.
......@@ -418,7 +418,7 @@ def to_gridColumn(field, **kwargs):
def to_gridColumnModel(table):
"""Build the L{GridColumnModel} configuration for the database C{table}.
"""Build the L{GridColumnModel} configuration for the database ``table``.
The conversion takes into account the L{GridModifier} instructions.
:type table: gluon.dal.Table
......@@ -460,14 +460,14 @@ def to_gridColumnModel(table):
def to_gridFilter(table, **kwargs):
"""Build the L{GridFilter} configuration for the database C{table}.
"""Build the L{GridFilter} configuration for the database ``table``.
The GridFilter is parametrized using the L{GridModifier}.
:type table: gluon.dal.Table
:param table:
:keyword kwargs: any of the Ext JS configuration parameters of the
C{App.grid.Filter} class. They are applied in the following order:
``App.grid.Filter`` class. They are applied in the following order:
constructor, modifiers, keyword arguments.
:returns: GridFilter
......@@ -476,14 +476,14 @@ def to_gridFilter(table, **kwargs):
not defined in the application model.
: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}.
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 C{("table2.field1", "operator", "comments")}.
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 C{grid_filters}.
:note: Rules are store in the modifier section ``grid_filters``.
"""
T = current.T
......@@ -575,14 +575,14 @@ def to_gridFilter(table, **kwargs):
def to_gridPanel(table, **kwargs):
"""Build the L{App.grid.Panel} configuration for the database C{table}.
"""Build the L{App.grid.Panel} configuration for the database ``table``.
The conversion takes into account the L{GridModifier} instructions.
:type table: gluon.dal.Table
:param table:
:keyword kwargs: any of the Ext JS configuration parameters of the
C{App.grid.Panel} class. They are applied in the following order:
``App.grid.Panel`` class. They are applied in the following order:
constructor, modifiers, keyword arguments.
:returns: GridPanel
......@@ -619,14 +619,14 @@ def to_gridPanel(table, **kwargs):
def to_jsonstore(table, **kwargs):
"""Build the L{DirectStore} configuration for the database C{table}.
"""Build the L{DirectStore} configuration for the database ``table``.
The conversion takes into account the L{StoreModifier} instructions.
:type table: gluon.dal.Table
:param table:
:keyword kwargs: any of the Ext JS configuration parameters of the
C{App.data.DirectStore} class. They are applied in the following order:
``App.data.DirectStore`` class. They are applied in the following order:
constructor, modifiers, keyword arguments.
:returns: DirectStore
......@@ -707,7 +707,7 @@ def to_jsonstore(table, **kwargs):
def to_model(table):
"""Build the L{Ext.data.Model} configuration for the database C{table}.
"""Build the L{Ext.data.Model} configuration for the database ``table``.
:type table: gluon.dal.Table
:param table:
......@@ -755,7 +755,7 @@ def to_model(table):
def to_panelWithUrlSelector(table, selectorTitle='Select', **kwargs):
"""Build the L{PanelWithUrlSelector} configuration
where the selector is a form derived from the database C{table}.
where the selector is a form derived from the database ``table``.
:type table: gluon.dal.Table
:param table:
......@@ -770,7 +770,7 @@ def to_panelWithUrlSelector(table, selectorTitle='Select', **kwargs):
It is mandatory to specified the baseUrl.
:keyword kwargs: any of the Ext JS configuration parameters of the
C{App.panel.WithUrlSelector} class.
``App.panel.WithUrlSelector`` class.
:returns: PanelWithUrlSelector
......@@ -816,11 +816,11 @@ def to_treeNodes():
def to_viewport(**kwargs):
"""Build the C{Ext.Viewport} configuration.
"""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
C{App.viewport.Viewport} class.
``App.viewport.Viewport`` class.
:returns: dict
......
This diff is collapsed.
""" implementation of the C{Ext.Direct} protocol on the server-side.
""" implementation of the ``Ext.Direct`` protocol on the server-side.
"""
......@@ -55,14 +55,14 @@ class DirectSvc(BaseSvc):
On the client-side:
- the API definition can be retrieved using the
URL: C{/myapplication/plugin_dbui/call/get_api}
URL: ``/myapplication/plugin_dbui/call/get_api``
- the URL to send requests is
C{/myapplication/plugin_dbui/call}
``/myapplication/plugin_dbui/call``
- remote functions and methods can be call in the
following way C{Dbui.myfunction(a, b, callback)}
and C{MyClass.mymethod(c, d, callback)} respectively.
following way ``Dbui.myfunction(a, b, callback)``
and ``MyClass.mymethod(c, d, callback)`` respectively.
In this implementation requests and response are JSON encoded.
......
......@@ -15,11 +15,11 @@ class ExtJSException(BaseException): pass
class Base(Storage):
"""Base class for Ext JS configurator.
The base class comes with two methods C{append_items}
and C{append_plugins}. They are required to append C{items}
and C{plugins}.
The base class comes with two methods ``append_items``
and ``append_plugins``. They are required to append ``items``
and ``plugins``.
:note: A protection is set to avoid changing the C{xtype} of the element.
:note: A protection is set to avoid changing the ``xtype`` of the element.
"""
xtype = None
......@@ -29,7 +29,7 @@ class Base(Storage):
:keyword kwargs: any Ext JS configuration parameter of the target class
:raise ExtJSException: if the keyword C{xtype}
:raise ExtJSException: if the keyword ``xtype``
is in the keyword arguments.
"""
......@@ -66,67 +66,67 @@ class Base(Storage):
class ArrayStore(Base):
"""Configurator for the C{Ext.data.ArrayStore}."""
"""Configurator for the ``Ext.data.ArrayStore``."""
xtype='arraystore'
class CheckBox(Base):
"""Configurator for C{Ext.form.field.Checkbox}."""
"""Configurator for ``Ext.form.field.Checkbox``."""
xtype = 'checkbox'
class ComboBox(Base):
"""Configurator for C{App.form.field.CombBox}."""
"""Configurator for ``App.form.field.CombBox``."""
xtype = 'xcombobox'
class DirectStore(Base):
"""Configurator for C{App.data.DirectStore}."""
"""Configurator for ``App.data.DirectStore``."""
xtype = 'xdirectstore'
class Field(Base):
"""Configurator for C{Ext.form.field.Field}."""
"""Configurator for ``Ext.form.field.Field``."""
xtype = 'field'
class FieldAceEditor(Base):
"""Configurator for the C{App.form.field.AceEditor}."""
"""Configurator for the ``App.form.field.AceEditor``."""
xtype='xaceeditorfield'
class FieldContainer(Base):
"""Configurator for C{Ext.form.FieldContainer}."""
"""Configurator for ``Ext.form.FieldContainer``."""
xtype = 'fieldcontainer'
class FieldDate(Base):
"""Configurator for C{Ext.form.field.Date}."""
"""Configurator for ``Ext.form.field.Date``."""
xtype = 'datefield'
class FieldDict(Base):
"""Configurator for C{App.form.field.Dict}."""
"""Configurator for ``App.form.field.Dict``."""
xtype = 'xdictfield'
class FieldList(Base):
"""Configurator for C{App.form.field.List}."""
"""Configurator for ``App.form.field.List``."""
xtype = 'xlistfield'
class FieldNumber(Base):
"""Configurator for C{Ext.form.field.Number}."""
"""Configurator for ``Ext.form.field.Number``."""
xtype = 'numberfield'
class FieldSet(Base):
"""Configurator for C{Ext.form.FieldSet}."""
"""Configurator for ``Ext.form.FieldSet``."""
xtype = 'fieldset'
class FieldText(Base):
"""Configurator for C{Ext.form.field.Text}.
"""Configurator for ``Ext.form.field.Text``.
:note: Regular expression for the validation can be written as a string.
......@@ -139,7 +139,7 @@ class FieldText(Base):
class FieldTextArea(Base):
"""Configurator for C{Ext.form.field.TextArea}.
"""Configurator for ``Ext.form.field.TextArea``.
:note: Regular expression for the validation can be written as a string.
......@@ -152,59 +152,59 @@ class FieldTextArea(Base):
class FieldTime(Base):
"""Configurator for C{Ext.form.field.Time}."""
"""Configurator for ``Ext.form.field.Time``."""
xtype = 'timefield'
class FormPanel(Base):
"""Configurator for C{App.form.Panel}."""
"""Configurator for ``App.form.Panel``."""
xtype = 'xform'
class GridColumn(dict):
"""Configurator for C{Ext.grid.Column}."""
"""Configurator for ``Ext.grid.Column``."""
class GridColumnModel(list):
"""Configurator for C{Ext.grid.ColumnModel}.
"""Configurator for ``Ext.grid.ColumnModel``.
:note: It is implemented as a C{list} of L{GridColumn}.
:note: It is implemented as a ``list`` of L{GridColumn}.
"""
class GridFilter(Base):
"""Configurator for C{App.grid.Filter}."""
"""Configurator for ``App.grid.Filter``."""
xtype = 'xgridfilter'
class GridPanel(Base):
"""Configurator for C{App.grid.Panel}."""
"""Configurator for ``App.grid.Panel``."""
xtype = 'xgrid'
class GridRowNumberer(Base):
"""Configurator for C{Ext.grid.column.RowNumberer}."""
"""Configurator for ``Ext.grid.column.RowNumberer``."""
xtype = 'rownumberer'
class GridTemplateColumn(Base):
"""Configurator for C{Ext.grid.TemplateColumn}."""
"""Configurator for ``Ext.grid.TemplateColumn``."""
xtype = 'templatecolumn'
class GridWithFilter(Base):
"""Configurator for C{App.panel.GridWithFilter}."""
"""Configurator for ``App.panel.GridWithFilter``."""
xtype = 'xgridwithfilter'
class JsonStore(Base):
"""Configurator for the C{Ext.data.JsonStore}."""
"""Configurator for the ``Ext.data.JsonStore``."""
xtype='jsonstore'
class Model(dict):
"""Configurator for the C{Ext.data.Model}. """
"""Configurator for the ``Ext.data.Model``. """
def __init__(self, **kwargs):
dict.__init__(self, **kwargs)
......@@ -212,36 +212,36 @@ class Model(dict):
class Panel(Base):
"""Configurator for C{Ext.panel.Panel}."""
"""Configurator for ``Ext.panel.Panel``."""
xtype = 'panel'
class PanelWithUrlSelector(Base):
"""Configurator for C{App.panel.WithUrlSelector}."""
"""Configurator for ``App.panel.WithUrlSelector``."""
xtype = 'xpanelwithurlselector'
class Store(Base):
"""Configurator for the C{Ext.data.Store}."""
"""Configurator for the ``Ext.data.Store``."""
xtype='store'
class TabPanel(Base):
"""Configurator for C{Ext.tab.Panel}."""
"""Configurator for ``Ext.tab.Panel``."""
xtype = 'tabpanel'
class Viewport(Base):
"""Configurator for C{App.viewport.Viewport}."""
"""Configurator for ``App.viewport.Viewport``."""
xtype = 'xviewport'
class Window(Base):
"""Configurator for C{Ext.Window}."""
"""Configurator for ``Ext.Window``."""
xtype = 'window'
class XmlStore(Base):
"""Configurator for the C{Ext.data.XmlStore}."""
"""Configurator for the ``Ext.data.XmlStore``."""
xtype='xmlstore'
\ No newline at end of file
......@@ -16,7 +16,7 @@ class FieldsModifier(Modifier):
def __init__(self, tablename):
"""Initialize the fields modifier associated to the database
table C{tablename}.
table ``tablename``.
The data structure of the fields modifier can be access
outside the class:
......@@ -24,21 +24,21 @@ class FieldsModifier(Modifier):
>>> p = PluginManager('dbui')
>>> modifier = p.dbui['modifier_fields'][tablename]
or internally via the attribute C{data}.
or internally via the attribute ``data``.
The keys of the C{data} structure are:
The keys of the ``data`` structure are:
- C{extjs_fields} (dict) Ext JS configuration options
for individual C{field}.
- ``extjs_fields`` (dict) Ext JS configuration options
for individual ``field``.
- C{composite_fields.main} (list) the first field
of the C{FieldContainer}.
- ``composite_fields.main`` (list) the first field
of the ``FieldContainer``.
- C{composite_fields.others} (list of list) the others field of
the C{FieldContainer}.
- ``composite_fields.others`` (list of list) the others field of
the ``FieldContainer``.
- There is one to one correspondence between the C{composite_fields.main}
and the C{composite_fields.others} lists.
- There is one to one correspondence between the ``composite_fields.main``
and the ``composite_fields.others`` lists.
:type tablename: str
:param tablename: name of the database table
......@@ -70,7 +70,7 @@ class FieldsModifier(Modifier):
def configure_field(self, field, **kwargs):
"""Update the configuration options of the Ext JS widget
associated to the C{field}.
associated to the ``field``.
Existing value of the configuration options are replace by those
defined by the keyword arguments.
......@@ -83,10 +83,10 @@ class FieldsModifier(Modifier):
def merge_fields(self, *fields, **kwargs):
"""Merge fields in a C{FieldContainer}.
"""Merge fields in a ``FieldContainer``.
The default configuration is with an horizontal layout with a unique
label defined by the keyword parameter C{fieldLabel}. More precisely,
label defined by the keyword parameter ``fieldLabel``. More precisely,
the following Ext JS configuration parameters are set::
combineLabels = True,
......@@ -96,11 +96,11 @@ class FieldsModifier(Modifier):
They can be super seed by the keyword arguments.
: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}.
- Each ``field`` is identified by its database field name.
- ``field`` should belong to the database table defined in the constructor.
- The first ``field`` is the main field of the ``FieldContainer``.
- The keyword arguments contains the configuration options of
the C{Ext.form.FieldContainer} widget.
the ``Ext.form.FieldContainer`` widget.
"""
# configuration of the FieldContainer
......
......@@ -26,7 +26,7 @@ def configure_forms(db, **extjs):
associated table name.
:note: The keyword arguments define values for the Ext JS configuration
options of he C{Ext.form.Panel} class.
options of he ``Ext.form.Panel`` class.
"""
if isinstance(db, DAL):
......@@ -48,7 +48,7 @@ class FormModifier(Modifier):
def __init__(self, tablename):
"""Initialize the form modifier associated to the database
table C{tablename}.
table ``tablename``.
The data structure of the form modifier can be access
outside the class:
......@@ -56,24 +56,24 @@ class FormModifier(Modifier):
>>> p = PluginManager('dbui')
>>> modifier = p.dbui['modifier_forms'][tablename]
or internally via the attribute C{data}.
or internally via the attribute ``data``.
The keys of the C{data} structure are:
The keys of the ``data`` structure are:
- C{extjs} (dict) Ext JS configuration options for the form widget.
- ``extjs`` (dict) Ext JS configuration options for the form widget.
- C{field_sets} (list of Storage) each C{Storage} defined a
C{FieldSets}. It has two keys C{fields} and C{extjs}.
- ``field_sets`` (list of Storage) each ``Storage`` defined a
``FieldSets``. It has two keys ``fields`` and ``extjs``.
The former is a list of field names belonging to the table
defined in the constructor. The latter is a dictionary with
the configuration options of the C{Ext.form.FieldSet} widget.
the configuration options of the ``Ext.form.FieldSet`` widget.
- C{hidden_fields} (list) list of field names to be hidden in
- ``hidden_fields`` (list) list of field names to be hidden in
the form. The fields have to belong to the table defined in
the constructor.
- C{mapper} (None or function) reference to the function used
to organize the C{FieldSet} in C{Tabs}, for example.
- ``mapper`` (None or function) reference to the function used
to organize the ``FieldSet`` in ``Tabs``, for example.
:type tablename: str
:param tablename: name of the database table
......@@ -112,12 +112,12 @@ class FormModifier(Modifier):
: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.