Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update docs/main/Extensions/Crud/index.rst #20

Merged
merged 1 commit into from

2 participants

@pihentagy

Added table_options to the customization settings.

@pihentagy pihentagy Update docs/main/Extensions/Crud/index.rst
Added __table_options__ to the customization settings.
72b8b50
@amol- amol- merged commit 0436c72 into TurboGears:master
@pihentagy pihentagy deleted the pihentagy:patch-1 branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 7, 2013
  1. @pihentagy

    Update docs/main/Extensions/Crud/index.rst

    pihentagy authored
    Added __table_options__ to the customization settings.
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 0 deletions.
  1. +12 −0 docs/main/Extensions/Crud/index.rst
View
12 docs/main/Extensions/Crud/index.rst
@@ -94,6 +94,12 @@ add utility methods on the fly::
'__field_widget_types__':{'description':TextArea}
}
+ __table_options__ = { # see Sprox TableBase and Sprox TableFiller
+ '__limit_fields__': ['title', 'desc'],
+ '__add_fields__': {'computed': None},
+ 'computed': lambda filler, row: row.some_field * 2
+ }
+
__setters__ = {
'done':('status', 'done'),
'todo':('status', 'new'),
@@ -107,6 +113,12 @@ and to edit the existing ones.
To have a look at the available options refer to
`Sprox FormBase <http://sprox.org/modules/sprox.formbase.html#module-sprox.formbase>`_
+The ``__table_options__`` dictionary will permit to tune the forms configuration.
+To have a look at the available options refer to
+`Sprox TableBase <http://sprox.org/modules/sprox.tablebase.html#sprox.tablebase.TableBase>`_,
+`Sprox TableFiller <http://sprox.org/modules/sprox.fillerbase.html?highlight=tablefiller#sprox.fillerbase.TableFiller>`_,
+and their parents as well.
+
The ``__setters__`` option provides a way to add new simple methods on the fly
to the controller. The key of the provided dictionary is the name of the method, while
the value is a tuple where the first argument is the attribute of the object
Something went wrong with that request. Please try again.