class documentation

class ModelState:

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):
Given a model, return a ModelState representing it.
def __eq__(self, other):

Undocumented

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

Undocumented

def __repr__(self):

Undocumented

def clone(self):
Return an exact copy of this ModelState.
def construct_managers(self):
Deep-clone the managers using deconstruction.
def get_constraint_by_name(self, name):

Undocumented

def get_field(self, field_name):

Undocumented

def get_index_by_name(self, name):

Undocumented

def render(self, apps):
Create a Model object from our current state into the given apps.
app_label =

Undocumented

bases =

Undocumented

fields =

Undocumented

managers =

Undocumented

name =

Undocumented

options =

Undocumented

@cached_property
name_lower =

Undocumented