| Home | Trees | Indices | Help |
|---|
|
|
Implement DocumentForm object. It map Document objects to Form and
works like ModelForm object :
>>> from couchdbkit.ext.django.forms import DocumentForm
# Create the form class.
>>> class ArticleForm(DocumentForm):
... class Meta:
... model = Article
# Creating a form to add an article.
>>> form = ArticleForm()
# Creating a form to change an existing article.
>>> article = Article.get(someid)
>>> form = ArticleForm(instance=article)
The generated Form class will have a form field for every model field.
Each document property has a corresponding default form field:
* StringProperty -> CharField,
* IntegerProperty -> IntegerField,
* DecimalProperty -> DecimalField,
* BooleanProperty -> BooleanField,
* FloatProperty -> FloatField,
* DateTimeProperty -> DateTimeField,
* DateProperty -> DateField,
* TimeProperty -> TimeField
More fields types will be supported soon.
|
|||
| DocumentFormOptions | |||
| DocumentFormMetaClass | |||
|
BaseDocumentForm Base Document Form object |
|||
|
DocumentForm The document form object |
|||
|
|||
|
|||
|
|||
|
|||
FIELDS_PROPERTES_MAPPING =
|
|||
__package__ =
|
|||
|
|||
Returns a dict containing the data in ``instance`` suitable for passing as a Form's ``initial`` keyword argument. ``properties`` is an optional list of properties names. If provided, only the named properties will be included in the returned dict. ``exclude`` is an optional list of properties names. If provided, the named properties will be excluded from the returned dict, even if they are listed in the ``properties`` argument. |
Returns a ``SortedDict`` containing form fields for the given document. ``properties`` is an optional list of properties names. If provided, only the named properties will be included in the returned properties. ``exclude`` is an optional list of properties names. If provided, the named properties will be excluded from the returned properties, even if they are listed in the ``properties`` argument. |
|
|||
FIELDS_PROPERTES_MAPPING
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Fri May 4 11:48:40 2012 | http://epydoc.sourceforge.net |