Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr body Expr Str Assign NameStore NameLoad Assign NameStore NameLoad ClassDef bases body Assign NameStore NameLoad decorator_list Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad keyword Str Assign NameStore ListLoad Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad decorator_list Assign AttributeStore NameLoad attr NameLoad FunctionDef arguments args NameParam defaults vararg kwarg body Expr Str Expr Call AttributeLoad NameLoad attr Return Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad decorator_list Assign AttributeStore NameLoad attr NameLoad FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr attr handlers ExceptHandler type NameLoad body Return NameLoad If BoolOpAnd CompareIsNot NameLoad NameLoad UnaryOpNot Call NameLoad NameLoad AttributeLoad NameLoad attr UnaryOpNot Call NameLoad NameLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr body Raise Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Return NameLoad Return AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Return NameLoad Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr If CompareEq NameLoad AttributeLoad NameLoad attr body Return NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad If AttributeLoad AttributeLoad NameLoad attr attr body Return Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad FunctionDef arguments args NameParam NameParam defaults body FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr Return NameLoad decorator_list Return NameLoad decorator_list Assign NameStore Call AttributeLoad NameLoad attr TryExcept body ImportFrom alias alias handlers ExceptHandler type NameLoad body ImportFrom alias identifier alias identifier For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad NameLoad If CompareIn Call NameLoad NameLoad ListLoad NameLoad NameLoad body Expr Call NameLoad AttributeLoad NameLoad attr NameLoad Call NameLoad Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign SubscriptStore NameLoad Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If BoolOpAnd Call NameLoad NameLoad AttributeLoad NameLoad attr CompareNotEq NameLoad AttributeLoad NameLoad attr CompareNotEq NameLoad AttributeLoad NameLoad attr CompareNotEq NameLoad NameLoad body Expr Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr body If CompareIsNot NameLoad NameLoad body Assign NameStore AttributeLoad NameLoad attr Expr Call NameLoad NameLoad NameLoad NameLoad Expr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body For NameStore Call AttributeLoad NameLoad attr body If CompareIn NameLoad AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore AttributeLoad NameLoad attr If CompareIs AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr orelse Assign NameStore AttributeLoad NameLoad attr Expr Call NameLoad NameLoad NameLoad NameLoad decorator_list Assign NameStore Dict Expr Call NameLoad AttributeLoad NameLoad attr NameLoad Expr Call NameLoad AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list decorator_list
N/A N/A 
Seamless Polymorphic Inheritance for Django Models
==================================================

Please see README.rst and DOCS.rst for further information.

Or on the Web:
http://chrisglass.github.com/django_polymorphic/
http://github.com/chrisglass/django_polymorphic

Copyright:
This code and affiliated files are (C) by Bert Constantin and individual contributors.
Please see LICENSE and AUTHORS for more information.
 __future__ absolute_import django.db models django.contrib.contenttypes.models ContentType django.utils six base PolymorphicModelBase managers PolymorphicManager query_translate translate_polymorphic_Q_object PolymorphicModel N/A N/A N/A six with_metaclass PolymorphicModelBase N/A models Model N/A N/A 
    Abstract base class that provides polymorphic behaviour
    for any model directly or indirectly derived from it.

    For usage instructions & examples please see documentation.

    PolymorphicModel declares one field for internal use (polymorphic_ctype)
    and provides a polymorphic manager as the default manager
    (and as 'objects').

    PolymorphicModel overrides the save() and __init__ methods.

    If your derived class overrides any of these methods as well, then you need
    to take care that you correctly call the method of the superclass, like:

        super(YourClass,self).save(*args,**kwargs)
     N/A polymorphic_model_marker True N/A polymorphic_query_multiline_output False Meta N/A N/A N/A abstract True N/A N/A polymorphic_ctype N/A N/A models ForeignKey ContentType null True editable False related_name polymorphic_%(app_label)s.%(class)s_set+ N/A polymorphic_internal_model_fields N/A polymorphic_ctype N/A objects N/A PolymorphicManager N/A base_objects N/A N/A models Manager translate_polymorphic_Q_object N/A N/A self_class q N/A N/A N/A N/A translate_polymorphic_Q_object self_class q N/A classmethod pre_save_polymorphic N/A N/A self N/A N/A N/A Normally not needed.
        This function may be called manually in special use-cases. When the object
        is saved for the first time, we store its real class in polymorphic_ctype.
        When the object later is retrieved by PolymorphicQuerySet, it uses this
        field to figure out the real class of this object
        (used by PolymorphicQuerySet._get_real_instances)
         N/A N/A N/A self polymorphic_ctype_id N/A N/A N/A self polymorphic_ctype N/A N/A N/A ContentType objects get_for_model self for_concrete_model False N/A N/A N/A pre_save_polymorphic alters_data True save N/A N/A self N/A args kwargs N/A N/A Overridden model save function which supports the polymorphism
        functionality (through pre_save_polymorphic). N/A N/A N/A self pre_save_polymorphic N/A N/A N/A N/A super PolymorphicModel self save args kwargs N/A N/A N/A save alters_data True get_real_instance_class N/A N/A self N/A N/A N/A 
        Normally not needed.
        If a non-polymorphic manager (like base_objects) has been used to
        retrieve objects, then the real class/type of these objects may be
        determined using this method.
         N/A N/A N/A model N/A N/A N/A N/A N/A ContentType objects get_for_id N/A self polymorphic_ctype_id model_class N/A N/A N/A AttributeError N/A N/A None N/A N/A N/A model None N/A N/A issubclass model N/A self __class__ N/A N/A issubclass model N/A N/A N/A self __class__ _meta proxy_for_model N/A N/A N/A RuntimeError N/A N/A ContentType {0} for {1} #{2} does not point to a subclass! format N/A self polymorphic_ctype_id model N/A self pk N/A model N/A get_real_concrete_instance_class_id N/A N/A self N/A N/A N/A model_class N/A N/A self get_real_instance_class N/A N/A model_class None N/A N/A None N/A N/A N/A N/A N/A ContentType objects get_for_model model_class for_concrete_model True pk N/A get_real_concrete_instance_class N/A N/A self N/A N/A N/A model_class N/A N/A self get_real_instance_class N/A N/A model_class None N/A N/A None N/A N/A N/A N/A N/A N/A ContentType objects get_for_model model_class for_concrete_model True model_class N/A get_real_instance N/A N/A self N/A N/A N/A Normally not needed.
        If a non-polymorphic manager (like base_objects) has been used to
        retrieve objects, then the complete object with it's real class/type
        and all fields may be retrieved with this method.
        Each method call executes one db query (if necessary). N/A real_model N/A N/A self get_real_instance_class N/A N/A real_model N/A self __class__ N/A N/A self N/A N/A N/A N/A real_model objects get pk N/A self pk N/A __init__ N/A N/A self N/A args kwargs N/A N/A Replace Django's inheritance accessor member functions for our model
        (self.__class__) with our own versions.
        We monkey patch them until a patch can be added to Django
        (which would probably be very small and make all of this obsolete).

        If we have inheritance of the form ModelA -> ModelB ->ModelC then
        Django creates accessors like this:
        - ModelA: modelb
        - ModelB: modela_ptr, modelb, modelc
        - ModelC: modela_ptr, modelb, modelb_ptr, modelc

        These accessors allow Django (and everyone else) to travel up and down
        the inheritance tree for the db object at hand.

        The original Django accessors use our polymorphic manager.
        But they should not. So we replace them with our own accessors that use
        our appropriate base_objects manager.
         N/A N/A N/A N/A super PolymorphicModel self __init__ args kwargs N/A N/A N/A self __class__ polymorphic_super_sub_accessors_replaced N/A N/A N/A N/A N/A self __class__ polymorphic_super_sub_accessors_replaced True create_accessor_function_for_model N/A N/A model accessor_name N/A N/A accessor_function N/A N/A self N/A N/A N/A attr N/A N/A N/A model base_objects get pk N/A self pk N/A attr N/A N/A accessor_function N/A N/A subclasses_and_superclasses_accessors N/A N/A self _get_inheritance_relation_fields_and_models N/A N/A django.db.models.fields.related ReverseOneToOneDescriptor ForwardManyToOneDescriptor N/A N/A N/A ImportError N/A django.db.models.fields.related SingleRelatedObjectDescriptor ReverseOneToOneDescriptor ReverseSingleRelatedObjectDescriptor ForwardManyToOneDescriptor N/A N/A name model N/A N/A subclasses_and_superclasses_accessors items N/A N/A orig_accessor N/A getattr N/A self __class__ name None N/A N/A N/A type orig_accessor N/A ReverseOneToOneDescriptor ForwardManyToOneDescriptor N/A N/A N/A setattr N/A self __class__ name N/A property N/A create_accessor_function_for_model model name N/A _get_inheritance_relation_fields_and_models N/A N/A self N/A N/A N/A helper function for __init__:
        determine names of all Django inheritance accessor member functions for type(self) add_model N/A N/A model field_name result N/A N/A N/A N/A result N/A field_name model N/A add_model_if_regular N/A N/A model field_name result N/A N/A N/A N/A N/A issubclass model N/A models Model N/A model N/A models Model N/A model N/A self __class__ N/A model PolymorphicModel N/A N/A N/A add_model model field_name result N/A add_all_super_models N/A N/A model result N/A N/A N/A N/A super_cls field_to_super N/A N/A N/A N/A model _meta parents items N/A N/A N/A field_to_super None N/A N/A field_name N/A field_to_super name N/A N/A add_model_if_regular super_cls field_name result N/A N/A add_all_super_models super_cls result N/A add_all_sub_models N/A N/A super_cls result N/A N/A N/A sub_cls N/A N/A super_cls __subclasses__ N/A N/A N/A super_cls N/A N/A sub_cls _meta parents N/A N/A field_to_super N/A N/A N/A sub_cls _meta parents N/A super_cls N/A N/A field_to_super None N/A N/A super_to_sub_related_field N/A field_to_super rel N/A N/A N/A super_to_sub_related_field related_name None N/A N/A to_subclass_fieldname N/A N/A N/A sub_cls __name__ lower N/A N/A to_subclass_fieldname N/A super_to_sub_related_field related_name N/A N/A add_model_if_regular sub_cls to_subclass_fieldname result N/A N/A result N/A N/A N/A add_all_super_models N/A self __class__ result N/A N/A add_all_sub_models N/A self __class__ result N/A result N/A N/A