Skip to content

Commit

Permalink
Updated README with data on tabbed forms.
Browse files Browse the repository at this point in the history
  • Loading branch information
nightmarebadger committed Jul 25, 2013
1 parent 94e64f7 commit 64d5f68
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,31 @@ looks in practice you can run these commands, assuming that you have a

You should now be able to access the demo site at http://0.0.0.0:8521

Using tabs in forms
-------------------

Mappings in form appear in new tabs. The mapping title is the name of the tab,
and the data in the mapping appears inside the tab.
Everything that isn't in a mapping appears inside a '*Default*' tab. If no
mappings are present, there are no tabs on the form.

To get a form with the tab *Default*, which has a *number* field, and the tab
*Mapping*, which has a *name* and *date* field, use the following example. If you
want to change the title of the tab, use `Mapping(title="New title")`

class Mapping(colander.Schema):
name = colander.SchemaNode(
colander.String(),
description='Content name')
date = colander.SchemaNode(
colander.Date(),
widget=deform.widget.DatePartsWidget(),
description='Content date')
class Schema(colander.Schema):
number = colander.SchemaNode(
colander.Integer())
mapping = Mapping()

Additional widgets / getting rid of legacy stuff
================================================

Expand Down

0 comments on commit 64d5f68

Please sign in to comment.