mptt :: models :: MPTTModelBase :: Class MPTTModelBase
[hide private]

Type MPTTModelBase


Metaclass for MPTT models

Instance Methods [hide private]

Inherited from django.db.models.base.ModelBase: add_to_class, copy_managers

Inherited from django.db.models.base.ModelBase (private): _prepare

Inherited from type: __call__, __cmp__, __delattr__, __eq__, __ge__, __getattribute__, __gt__, __hash__, __init__, __le__, __lt__, __ne__, __repr__, __setattr__, __subclasses__, mro

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

Class Methods [hide private]
 
register(meta, cls, **kwargs)
For the weird cases when you need to add tree-ness to an *existing* class.
Static Methods [hide private]
a new object with type S, a subtype of T
__new__(meta, class_name, bases, class_dict)
Create subclasses of MPTTModel.
Properties [hide private]

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

Inherited from object: __class__

Method Details [hide private]

__new__(meta, class_name, bases, class_dict)
Static Method

 

Create subclasses of MPTTModel. This:

  • adds the MPTT fields to the class
  • adds a TreeManager to the model
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

register(meta, cls, **kwargs)
Class Method

 

For the weird cases when you need to add tree-ness to an *existing* class. For other cases you should subclass MPTTModel instead of calling this.