Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias Import alias FunctionDef arguments args NameParam defaults body Expr Str Return BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Str TupleLoad TupleLoad Str Str If Call NameLoad AttributeLoad NameLoad attr Str NameLoad body Assign SubscriptStore NameLoad Index Str BinOpMod Str Call NameLoad AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad BinOpMod Str AttributeLoad NameLoad attr TupleLoad AttributeLoad NameLoad attr Dict Str Str Str Str Str Str Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Call NameLoad Str TupleLoad NameLoad NameLoad Expr Call NameLoad NameLoad Str NameLoad Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad If BoolOpAnd UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr CompareNotEq AttributeLoad NameLoad attr NameLoad body Expr Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr BinOpMod Str AttributeLoad NameLoad attr Call NameLoad NameLoad decorator_list decorator_list ClassDef bases Call NameLoad NameLoad AttributeLoad NameLoad attr body Expr Str ClassDef bases body Expr Str Assign NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If Call AttributeLoad NameLoad attr Str body Assign NameStore NameLoad orelse Assign NameStore BinOpMod Str NameLoad If BoolOpAnd Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad UnaryOpNot Call AttributeLoad NameLoad attr body If Call AttributeLoad NameLoad attr Str body Assign NameStore NameLoad orelse If NameLoad body Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore NameLoad If CompareNotEq Call NameLoad NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad BinOpBitAnd Call NameLoad Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Return IfExp NameLoad Call NameLoad Call NameLoad NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr ListComp Call AttributeLoad NameLoad attr keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str keyword Num comprehension NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return BinOpMod Str Call AttributeLoad AttributeLoad Call AttributeLoad NameLoad attr attr attr decorator_list NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return BinOpMod Str Call AttributeLoad AttributeLoad Call AttributeLoad NameLoad attr attr attr decorator_list NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Str NameLoad Return Call NameLoad NameLoad Str AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Str NameLoad Return Call NameLoad NameLoad Str Str decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str If Call NameLoad NameLoad BinOpMod Str AttributeLoad NameLoad attr body Return Call NameLoad NameLoad BinOpMod Str AttributeLoad NameLoad attr orelse Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr Return IfExp NameLoad AttributeLoad NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Dict BinOpMod Str Call AttributeLoad NameLoad attr BinOpMod Str Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword AttributeLoad NameLoad attr attr Str Str Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword AttributeLoad NameLoad attr attr Str Str Assign NameStore ListComp Call AttributeLoad NameLoad attr keyword SubscriptLoad NameLoad Index Str keyword SubscriptLoad NameLoad Index Str keyword BinOpAdd BinOpAdd SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Num comprehension NameStore NameLoad comprehension NameStore NameLoad Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If Call AttributeLoad NameLoad attr body If UnaryOpNot NameLoad body Return Call AttributeLoad AttributeLoad Call AttributeLoad NameLoad attr attr attr orelse Return Call AttributeLoad AttributeLoad Call AttributeLoad NameLoad attr attr attr keyword AttributeLoad NameLoad attr Assign NameStore Dict BinOpMod Str Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index BinOpMod Str Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad Call AttributeLoad NameLoad attr attr attr NameLoad If UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr BinOpMod Str Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Dict BinOpMod Str Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index BinOpMod Str Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad Call AttributeLoad NameLoad attr attr attr NameLoad If UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr BinOpMod Str Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad BinOpAdd ListComp TupleLoad AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad ListLoad TupleLoad AttributeLoad NameLoad attr NameLoad For NameStore Call AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr ListLoad For NameStore NameLoad body Assert CompareIn AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad Index AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If Call NameLoad NameLoad Str body Assign NameStore Call AttributeLoad AttributeLoad Call AttributeLoad NameLoad attr attr attr keyword ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Return NameLoad orelse Return Call AttributeLoad NameLoad attr keyword NameLoad keyword Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str If Call AttributeLoad NameLoad attr body Return NameLoad Return SubscriptLoad Call AttributeLoad Call AttributeLoad NameLoad attr attr BinOpMod Str Call AttributeLoad NameLoad attr Index Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return UnaryOpNot Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return CompareIs AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return NameLoad Return Call AttributeLoad Call AttributeLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword NameLoad keyword NameLoad attr keyword AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Return Call AttributeLoad NameLoad attr NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam defaults kwarg body If Call NameLoad NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr If Call AttributeLoad NameLoad attr body If Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call NameLoad NameLoad Str orelse If NameLoad body Expr Call AttributeLoad NameLoad attr decorator_list Call NameLoad NameLoad keyword Str FunctionDef arguments args NameParam defaults kwarg body If Call NameLoad NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Call NameLoad NameLoad keyword Str
N/A N/A Models for closuretree application. django.db models django.db.models.base ModelBase django.db.models.signals post_save pre_delete django.dispatch receiver django.utils.six with_metaclass N/A sys _closure_model_unicode N/A N/A self N/A N/A N/A __unicode__ implementation for the dynamically created
        <Model>Closure model.
     N/A N/A Closure from %s to %s N/A N/A self parent N/A self child N/A create_closure_model N/A N/A cls N/A N/A N/A Creates a <Model>Closure model in the same module as the model. N/A meta_vals N/A unique_together N/A N/A parent child N/A N/A getattr N/A cls _meta db_table None N/A N/A N/A meta_vals N/A db_table N/A %sclosure N/A getattr N/A cls _meta db_table N/A model N/A type N/A %sClosure N/A cls __name__ N/A N/A models Model N/A parent child depth __module__ __unicode__ Meta N/A N/A models ForeignKey N/A cls __name__ related_name N/A N/A cls closure_parentref N/A N/A models ForeignKey N/A cls __name__ related_name N/A N/A cls closure_childref N/A N/A models IntegerField N/A cls __module__ _closure_model_unicode N/A type Meta N/A object meta_vals N/A N/A setattr cls _closure_model model N/A model N/A ClosureModelBase N/A ModelBase N/A N/A Metaclass for Models inheriting from ClosureModel,
        to ensure the <Model>Closure model is created.
     __init__ N/A N/A cls name bases dct N/A N/A N/A Create the closure model in addition
            to doing all the normal django stuff.
         N/A N/A N/A N/A super ClosureModelBase cls __init__ name bases dct N/A N/A N/A N/A N/A N/A cls _meta get_parent_list N/A N/A cls __module__ __name__ N/A N/A N/A setattr N/A N/A sys modules N/A N/A cls __module__ N/A %sClosure N/A cls __name__ N/A create_closure_model cls N/A N/A ClosureModel N/A N/A with_metaclass ClosureModelBase N/A models Model N/A N/A Provides methods to assist in a tree based structure. Meta N/A N/A N/A We make this an abstract class, it needs to be inherited from. N/A abstract True N/A __setattr__ N/A N/A self name value N/A N/A N/A N/A N/A name endswith _id N/A N/A id_field_name name N/A N/A id_field_name N/A %s_id name N/A N/A N/A N/A name startswith N/A self _closure_sentinel_attr N/A hasattr self id_field_name N/A N/A N/A self _closure_change_check N/A N/A N/A N/A name endswith _id N/A N/A obj_id value N/A N/A value N/A N/A obj_id N/A value pk N/A N/A obj_id None N/A N/A N/A getattr self id_field_name obj_id N/A N/A N/A N/A self _closure_change_init N/A N/A N/A N/A super ClosureModel self __setattr__ name value N/A _toplevel N/A N/A cls N/A N/A N/A Find the top level of the chain we're in.

            For example, if we have:
            C inheriting from B inheriting from A inheriting from ClosureModel
            C._toplevel() will return A.
         N/A superclasses N/A list N/A N/A set N/A N/A ClosureModel __subclasses__ N/A set N/A N/A N/A cls _meta get_parent_list N/A N/A superclasses N/A next N/A iter superclasses cls N/A classmethod rebuildtable N/A N/A cls N/A N/A N/A Regenerate the entire closuretree. N/A N/A N/A N/A N/A N/A N/A cls _closure_model objects all delete N/A N/A N/A N/A N/A cls _closure_model objects bulk_create N/A N/A N/A cls _closure_model parent_id N/A x N/A pk child_id N/A x N/A pk depth 0 N/A x N/A N/A N/A cls objects values pk N/A node N/A N/A N/A cls objects all N/A N/A N/A N/A node _closure_createlink N/A classmethod closure_parentref N/A N/A cls N/A N/A N/A How to refer to parents in the closure tree N/A N/A %sclosure_children N/A N/A N/A N/A N/A cls _toplevel __name__ lower N/A classmethod N/A _closure_parentref closure_parentref closure_childref N/A N/A cls N/A N/A N/A How to refer to children in the closure tree N/A N/A %sclosure_parents N/A N/A N/A N/A N/A cls _toplevel __name__ lower N/A classmethod N/A _closure_childref closure_childref _closure_sentinel_attr N/A N/A self N/A N/A N/A The attribute we need to watch to tell if the
            parent/child relationships have changed
         N/A meta N/A getattr self ClosureMeta None N/A N/A getattr meta sentinel_attr N/A self _closure_parent_attr N/A property _closure_parent_attr N/A N/A self N/A N/A N/A The attribute or property that holds the parent object. N/A meta N/A getattr self ClosureMeta None N/A N/A getattr meta parent_attr parent N/A property _closure_parent_pk N/A N/A self N/A N/A N/A What our parent pk is in the closure tree. N/A N/A hasattr self N/A %s_id N/A self _closure_parent_attr N/A N/A N/A getattr self N/A %s_id N/A self _closure_parent_attr N/A N/A parent N/A getattr self N/A self _closure_parent_attr N/A N/A parent N/A parent pk None N/A property _closure_deletelink N/A N/A self oldparentpk N/A N/A N/A Remove incorrect links from the closure tree. N/A N/A N/A N/A N/A N/A N/A self _closure_model objects filter N/A N/A parent__%s__child N/A N/A self _closure_parentref N/A child__%s__parent N/A N/A self _closure_childref oldparentpk N/A self pk delete N/A _closure_createlink N/A N/A self N/A N/A N/A Create a link in the closure tree. N/A linkparents N/A N/A N/A N/A N/A N/A self _closure_model objects filter child__pk N/A self _closure_parent_pk values parent depth N/A linkchildren N/A N/A N/A N/A N/A N/A self _closure_model objects filter parent__pk N/A self pk values child depth N/A newlinks N/A N/A N/A self _closure_model parent_id N/A p N/A parent child_id N/A c N/A child depth N/A N/A N/A p N/A depth N/A c N/A depth 1 N/A p linkparents N/A c linkchildren N/A N/A N/A N/A N/A self _closure_model objects bulk_create newlinks N/A get_ancestors N/A N/A self include_self depth N/A False None N/A N/A Return all the ancestors of this object. N/A N/A N/A self is_root_node N/A N/A N/A include_self N/A N/A N/A N/A N/A N/A N/A self _toplevel objects none N/A N/A N/A N/A N/A N/A N/A self _toplevel objects filter pk N/A self pk N/A params N/A N/A %s__child N/A N/A self _closure_parentref N/A self pk N/A N/A depth None N/A N/A N/A params N/A N/A %s__depth__lte N/A N/A self _closure_parentref depth N/A ancestors N/A N/A N/A N/A N/A self _toplevel objects filter params N/A N/A include_self N/A N/A ancestors N/A N/A ancestors exclude pk N/A self pk N/A N/A N/A ancestors order_by N/A %s__depth N/A N/A self _closure_parentref N/A get_descendants N/A N/A self include_self depth N/A False None N/A N/A Return all the descendants of this object. N/A params N/A N/A %s__parent N/A N/A self _closure_childref N/A self pk N/A N/A depth None N/A N/A N/A params N/A N/A %s__depth__lte N/A N/A self _closure_childref depth N/A descendants N/A N/A N/A N/A N/A self _toplevel objects filter params N/A N/A include_self N/A N/A descendants N/A N/A descendants exclude pk N/A self pk N/A N/A N/A descendants order_by N/A %s__depth N/A N/A self _closure_childref N/A prepopulate N/A N/A self queryset N/A N/A N/A Perpopulate a descendants query's children efficiently.
            Call like: blah.prepopulate(blah.get_descendants().select_related(stuff))
         N/A objs N/A list queryset N/A hashobjs N/A dict N/A N/A N/A N/A x pk x N/A x objs N/A N/A N/A self pk self N/A descendant N/A N/A hashobjs values N/A N/A N/A descendant _cached_children N/A N/A descendant objs N/A N/A N/A N/A descendant _closure_parent_pk hashobjs N/A parent N/A hashobjs N/A N/A descendant _closure_parent_pk N/A N/A N/A N/A parent _cached_children append descendant N/A get_children N/A N/A self N/A N/A N/A Return all the children of this object. N/A N/A hasattr self _cached_children N/A N/A children N/A N/A N/A N/A N/A self _toplevel objects filter pk__in N/A N/A n pk N/A n N/A self _cached_children N/A N/A children _result_cache N/A self _cached_children N/A children N/A N/A N/A N/A self get_descendants include_self False depth 1 N/A get_root N/A N/A self N/A N/A N/A Return the furthest ancestor of this node. N/A N/A N/A self is_root_node N/A N/A self N/A N/A N/A N/A N/A N/A self get_ancestors order_by N/A -%s__depth N/A N/A self _closure_parentref N/A 0 N/A is_child_node N/A N/A self N/A N/A N/A Is this node a child, i.e. has a parent? N/A N/A N/A N/A self is_root_node N/A is_root_node N/A N/A self N/A N/A N/A Is this node a root, i.e. has no parent? N/A N/A N/A self _closure_parent_pk None N/A is_descendant_of N/A N/A self other include_self N/A False N/A N/A Is this node a descendant of `other`? N/A N/A N/A other pk N/A self pk N/A N/A include_self N/A N/A N/A N/A N/A N/A N/A N/A N/A self _closure_model objects filter parent other child self exclude pk N/A self pk exists N/A is_ancestor_of N/A N/A self other include_self N/A False N/A N/A Is this node an ancestor of `other`? N/A N/A N/A other is_descendant_of self include_self include_self N/A _closure_change_init N/A N/A self N/A N/A N/A Part of the change detection. Setting up N/A N/A self _closure_old_parent_pk N/A self _closure_parent_pk N/A _closure_change_check N/A N/A self N/A N/A N/A Part of the change detection. Have we changed since we began? N/A N/A hasattr self _closure_old_parent_pk N/A _closure_change_oldparent N/A N/A self N/A N/A N/A Part of the change detection. What we used to be N/A N/A self _closure_old_parent_pk N/A N/A closure_model_save N/A N/A sender N/A kwargs N/A N/A N/A issubclass sender ClosureModel N/A N/A instance N/A kwargs N/A instance N/A create N/A kwargs N/A created N/A create N/A N/A closure_instance N/A N/A instance _closure_model parent instance child instance depth 0 N/A N/A N/A closure_instance save N/A N/A N/A instance _closure_change_check N/A N/A N/A N/A instance _closure_change_oldparent N/A N/A N/A N/A instance _closure_deletelink N/A N/A instance _closure_change_oldparent N/A N/A N/A instance _closure_createlink N/A N/A delattr instance _closure_old_parent_pk N/A N/A create N/A N/A N/A N/A instance _closure_createlink N/A N/A receiver post_save dispatch_uid closure-model-save closure_model_delete N/A N/A sender N/A kwargs N/A N/A N/A issubclass sender ClosureModel N/A N/A instance N/A kwargs N/A instance N/A N/A N/A instance _closure_deletelink N/A instance _closure_parent_pk N/A N/A receiver pre_delete dispatch_uid closure-model-delete