Base class for ModelForm.
This overrides the forms.BaseForm constructor and adds a save() method.
This class does not have a special metaclass; the magic metaclass is
added by the subclass ModelForm.
def google.appengine.ext.db.djangoforms.BaseModelForm.__init__ |
( |
|
self, |
|
|
|
data = None , |
|
|
|
files = None , |
|
|
|
auto_id = None , |
|
|
|
prefix = None , |
|
|
|
initial = None , |
|
|
|
error_class = None , |
|
|
|
label_suffix = None , |
|
|
|
instance = None |
|
) |
| |
Constructor.
Args (all optional and defaulting to None):
data: dict of data values, typically from a POST request)
files: dict of file upload values; Django 0.97 or later only
auto_id, prefix: see Django documentation
initial: dict of initial values
error_class, label_suffix: see Django 0.97 or later documentation
instance: Model instance to be used for additional initial values
Except for initial and instance, these arguments are passed on to
the forms.BaseForm constructor unchanged, but only if not None.
Some arguments (files, error_class, label_suffix) are only
supported by Django 0.97 or later. Leave these blank (i.e. None)
when using Django 0.96. Their default values will be used with
Django 0.97 or later even when they are explicitly set to None.
def google.appengine.ext.db.djangoforms.BaseModelForm.save |
( |
|
self, |
|
|
|
commit = True |
|
) |
| |
Save this form's cleaned data into a model instance.
Args:
commit: optional bool, default True; if true, the model instance
is also saved to the datastore.
Returns:
A model instance. If a model instance was already associated
with this form instance (either passed to the constructor with
instance=... or by a previous save() call), that same instance
is updated and returned; if no instance was associated yet, one
is created by this call.
Raises:
ValueError if the data couldn't be validated.
The documentation for this class was generated from the following file:
- code/googleappengine-read-only/python/google/appengine/ext/db/djangoforms.py