MCPcopy
hub / github.com/django/django / from_apps

Method from_apps

django/db/migrations/state.py:595–601  ·  view source on GitHub ↗

Take an Apps and return a ProjectState matching it.

(cls, apps)

Source from the content-addressed store, hash-verified

593
594 @classmethod
595 def from_apps(cls, apps):
596 """Take an Apps and return a ProjectState matching it."""
597 app_models = {}
598 for model in apps.get_models(include_swapped=True):
599 model_state = ModelState.from_model(model)
600 app_models[(model_state.app_label, model_state.name_lower)] = model_state
601 return cls(app_models)
602
603 def __eq__(self, other):
604 return self.models == other.models and self.real_apps == other.real_apps

Calls 2

from_modelMethod · 0.80
get_modelsMethod · 0.45