Undocumented
Class | AppConfigStub |
Stub of an AppConfig. Only provides a label and a dict of models. |
Class | ModelState |
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. |
Class | ProjectState |
Represent the entire project's overall state. This is the item that is passed around - do it here rather than at the app level so that cross-app FKs/etc. resolve properly. |
Class | StateApps |
Subclass of the global Apps registry class to better handle dynamic model additions and removals. |
Function | _get_app_label_and_model_name |
Undocumented |
Function | _get_related_models |
Return all models that have a direct relationship to the given model. |
Function | get_related_models_recursive |
Return all models that have a direct or indirect relationship to the given model. |
Function | get_related_models_tuples |
Return a list of typical (app_label, model_name) tuples for all related models for the given model. |
Return all models that have a direct or indirect relationship to the given model.
Relationships are either defined by explicit relational fields, like ForeignKey, ManyToManyField or OneToOneField, or by inheriting from another model (a superclass is related to its subclasses, but not vice versa). Note, however, that a model inheriting from a concrete model is also related to its superclass through the implicit *_ptr OneToOneField on the subclass.