class documentation

class ModelState: (source)

View In Hierarchy

Represent a Django Model. Don't use the actual Model class as it's not designed to have its options changed - instead, mutate this one and then render it into a Model as required. Note that while you are allowed to mutate .fields, you are not allowed to mutate the Field instances inside there themselves - you must instead assign new ones, as these are not detached during a clone.

Class Method from_model Given a model, return a ModelState representing it.
Method __eq__ Undocumented
Method __init__ Undocumented
Method __repr__ Undocumented
Method clone Return an exact copy of this ModelState.
Method construct_managers Deep-clone the managers using deconstruction.
Method get_constraint_by_name Undocumented
Method get_field Undocumented
Method get_index_by_name Undocumented
Method render Create a Model object from our current state into the given apps.
Instance Variable app_label Undocumented
Instance Variable bases Undocumented
Instance Variable fields Undocumented
Instance Variable managers Undocumented
Instance Variable name Undocumented
Instance Variable options Undocumented
Property name_lower Undocumented
@classmethod
def from_model(cls, model, exclude_rels=False): (source)

Given a model, return a ModelState representing it.

def __eq__(self, other): (source)

Undocumented

def __init__(self, app_label, name, fields, options=None, bases=None, managers=None): (source)

Undocumented

def __repr__(self): (source)

Undocumented

def clone(self): (source)

Return an exact copy of this ModelState.

def construct_managers(self): (source)

Deep-clone the managers using deconstruction.

def get_constraint_by_name(self, name): (source)

Undocumented

def get_field(self, field_name): (source)

Undocumented

def get_index_by_name(self, name): (source)

Undocumented

def render(self, apps): (source)

Create a Model object from our current state into the given apps.

app_label = (source)

Undocumented

Undocumented

Undocumented

managers = (source)

Undocumented

Undocumented

Undocumented

Undocumented