|
| verbose_name |
|
| name |
|
| default |
|
| required |
|
| validator |
|
| choices |
|
| indexed |
|
| creation_counter |
|
| model_class |
|
int | creation_counter = 0 |
|
| data_type = str |
|
def google.appengine.ext.db.djangoforms.Property.get_form_field |
( |
|
self, |
|
|
|
form_class = forms.CharField , |
|
|
|
kwargs |
|
) |
| |
Return a Django form field appropriate for this property.
Args:
form_class: a forms.Field subclass, default forms.CharField
Additional keyword arguments are passed to the form_class constructor,
with certain defaults:
required: self.required
label: prettified self.verbose_name, if not None
widget: a forms.Select instance if self.choices is non-empty
initial: self.default, if not None
Returns:
A fully configured instance of form_class, or None if no form
field should be generated for this property.
def google.appengine.ext.db.djangoforms.Property.get_value_for_form |
( |
|
self, |
|
|
|
instance |
|
) |
| |
Extract the property value from the instance for use in a form.
Override this to do a property- or field-specific type conversion.
Args:
instance: a db.Model instance
Returns:
The property's value extracted from the instance, possibly
converted to a type suitable for a form field; possibly None.
By default this returns the instance attribute's value unchanged.
def google.appengine.ext.db.djangoforms.Property.make_value_from_form |
( |
|
self, |
|
|
|
value |
|
) |
| |
Convert a form value to a property value.
Override this to do a property- or field-specific type conversion.
Args:
value: the cleaned value retrieved from the form field
Returns:
A value suitable for assignment to a model instance's property;
possibly None.
By default this converts the value to self.data_type if it
isn't already an instance of that type, except if the value is
empty, in which case we return None.
The documentation for this class was generated from the following file:
- code/googleappengine-read-only/python/google/appengine/ext/db/djangoforms.py