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

Public Member Functions

def __init__
 
def validate
 
def validate_list_contents
 
def empty
 
def default_value
 
def get_value_for_datastore
 
def make_value_from_datastore
 
def make_value_from_datastore_index_value
 
- 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
 

Public Attributes

 item_type
 
- Public Attributes inherited from google.appengine.ext.db.Property
 verbose_name
 
 name
 
 default
 
 required
 
 validator
 
 choices
 
 indexed
 
 creation_counter
 
 model_class
 

Static Public Attributes

 data_type = list
 
- Static Public Attributes inherited from google.appengine.ext.db.Property
int creation_counter = 0
 
 data_type = str
 

Detailed Description

A property that stores a list of things.

This is a parameterized property; the parameter must be a valid
non-list data type, and all items must conform to this type.

Constructor & Destructor Documentation

def google.appengine.ext.db.ListProperty.__init__ (   self,
  item_type,
  verbose_name = None,
  default = None,
  kwds 
)
Construct ListProperty.

Args:
  item_type: Type for the list items; must be one of the allowed property
types.
  verbose_name: Optional verbose name.
  default: Optional default value; if omitted, an empty list is used.
  **kwds: Optional additional keyword arguments, passed to base class.

Note that the only permissible value for 'required' is True.

Member Function Documentation

def google.appengine.ext.db.ListProperty.default_value (   self)
Default value for list.

Because the property supplied to 'default' is a static value,
that value must be shallow copied to prevent all fields with
default values from sharing the same instance.

Returns:
  Copy of the default value.
def google.appengine.ext.db.ListProperty.empty (   self,
  value 
)
Is list property empty.

[] is not an empty value.

Returns:
  True if value is None, else false.
def google.appengine.ext.db.ListProperty.get_value_for_datastore (   self,
  model_instance 
)
Get value from property to send to datastore.

Returns:
  validated list appropriate to save in the datastore.
def google.appengine.ext.db.ListProperty.make_value_from_datastore (   self,
  value 
)
Native representation of this property.

If this list is a list of datetime.date or datetime.time, we convert
the list of datetime.datetime retrieved from the entity into
datetime.date or datetime.time.

See base class method documentation for details.
def google.appengine.ext.db.ListProperty.validate (   self,
  value 
)
Validate list.

Returns:
  A valid value.

Raises:
  BadValueError if property is not a list whose items are instances of
  the item_type given to the constructor.
def google.appengine.ext.db.ListProperty.validate_list_contents (   self,
  value 
)
Validates that all items in the list are of the correct type.

Returns:
  The validated list.

Raises:
  BadValueError if the list has items are not instances of the
  item_type given to the constructor.

The documentation for this class was generated from the following file: