App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | List of all members
google.appengine.ext.db.djangoforms.Property Class Reference
Inheritance diagram for google.appengine.ext.db.djangoforms.Property:
google.appengine.ext.db.Property

Public Member Functions

def get_form_field
 
def get_value_for_form
 
def make_value_from_form
 
- Public Member Functions inherited from google.appengine.ext.db.Property
def __init__
 
def __property_config__
 
def __get__
 
def __set__
 
def default_value
 
def validate
 
def empty
 
def get_value_for_datastore
 
def get_updated_value_for_datastore
 
def make_value_from_datastore_index_value
 
def make_value_from_datastore
 
def datastore_type
 

Additional Inherited Members

- Public Attributes inherited from google.appengine.ext.db.Property
 verbose_name
 
 name
 
 default
 
 required
 
 validator
 
 choices
 
 indexed
 
 creation_counter
 
 model_class
 
- Static Public Attributes inherited from google.appengine.ext.db.Property
int creation_counter = 0
 
 data_type = str
 

Member Function Documentation

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: