google :: appengine :: ext :: db :: PropertiedClass :: Class PropertiedClass
[hide private]
[frames] | no frames]

Type PropertiedClass


Meta-class for initializing Model classes properties.

Used for initializing Properties defined in the context of a model.
By using a meta-class much of the configuration of a Property
descriptor becomes implicit.  By using this meta-class, descriptors
that are of class Model are notified about which class they
belong to and what attribute they are associated with and can
do appropriate initialization via __property_config__.

Duplicate properties are not permitted.

Instance Methods [hide private]
the object's type

__init__(cls, name, bases, dct, map_kind=True)
Initializes a class that might have property definitions.

Inherited from type: __call__, __delattr__, __eq__, __ge__, __getattribute__, __gt__, __hash__, __instancecheck__, __le__, __lt__, __ne__, __new__, __repr__, __setattr__, __subclasscheck__, __subclasses__, mro

Inherited from object: __format__, __reduce__, __reduce_ex__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from type: __abstractmethods__, __base__, __bases__, __basicsize__, __dictoffset__, __flags__, __itemsize__, __mro__, __name__, __weakrefoffset__

Inherited from object: __class__

Method Details [hide private]

__init__(cls, name, bases, dct, map_kind=True)
(Constructor)

 
Initializes a class that might have property definitions.

This method is called when a class is created with the PropertiedClass
meta-class.

Loads all properties for this model and its base classes in to a dictionary
for easy reflection via the 'properties' method.

Configures each property defined in the new class.

Duplicate properties, either defined in the new class or defined separately
in two base classes are not permitted.

Properties may not assigned to names which are in the list of
_RESERVED_WORDS.  It is still possible to store a property using a reserved
word in the datastore by using the 'name' keyword argument to the Property
constructor.

Args:
  cls: Class being initialized.
  name: Name of new class.
  bases: Base classes of new class.
  dct: Dictionary of new definitions for class.

Raises:
  DuplicatePropertyError when a property is duplicated either in the new
    class or separately in two base classes.
  ReservedWordError when a property is given a name that is in the list of
    reserved words, attributes of Model and names of the form '__.*__'.

Returns:
the object's type

Overrides: object.__init__