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.polymodel.PolymorphicClass Class Reference
Inheritance diagram for google.appengine.ext.db.polymodel.PolymorphicClass:
google.appengine.ext.db.PropertiedClass

Public Member Functions

def __init__
 
- Public Member Functions inherited from google.appengine.ext.db.PropertiedClass
def __init__
 

Detailed Description

Meta-class for initializing PolymorphicClasses.

This class extends PropertiedClass to add a few static attributes to
new polymorphic classes necessary for their correct functioning.

Constructor & Destructor Documentation

def google.appengine.ext.db.polymodel.PolymorphicClass.__init__ (   cls,
  name,
  bases,
  dct 
)
Initializes a class that belongs to a polymorphic hierarchy.

This method configures a few built-in attributes of polymorphic
models:

  __root_class__: If the new class is a root class, __root_class__ is set to
itself so that it subclasses can quickly know what the root of
their hierarchy is and what kind they are stored in.
  __class_hierarchy__: List of classes describing the new model's place
in the class hierarchy in reverse MRO order.  The first element is
always the root class while the last element is always the new class.

MRO documentation: http://www.python.org/download/releases/2.3/mro/

For example:
  class Foo(PolymorphicClass): ...

  class Bar(Foo): ...

  class Baz(Bar): ...

  Foo.__class_hierarchy__ == [Foo]
  Bar.__class_hierarchy__ == [Foo, Bar]
  Baz.__class_hierarchy__ == [Foo, Bar, Baz]

Unless the class is a root class or PolyModel itself, it is not
inserted in to the kind-map like other models.  However, all polymorphic
classes, are inserted in to the class-map which maps the class-key to
implementation.  This class key is consulted using the polymorphic instances
discriminator (the 'class' property of the entity) when loading from the
datastore.

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