Return the model with the given case-insensitive model_name. Raise LookupError if no model exists with this name.
(self, model_name, require_ready=True)
| 222 | return app_config_class(app_name, app_module) |
| 223 | |
| 224 | def get_model(self, model_name, require_ready=True): |
| 225 | """ |
| 226 | Return the model with the given case-insensitive model_name. |
| 227 | |
| 228 | Raise LookupError if no model exists with this name. |
| 229 | """ |
| 230 | if require_ready: |
| 231 | self.apps.check_models_ready() |
| 232 | else: |
| 233 | self.apps.check_apps_ready() |
| 234 | try: |
| 235 | return self.models[model_name.lower()] |
| 236 | except KeyError: |
| 237 | raise LookupError( |
| 238 | "App '%s' doesn't have a '%s' model." % (self.label, model_name) |
| 239 | ) |
| 240 | |
| 241 | def get_models(self, include_auto_created=False, include_swapped=False): |
| 242 | """ |
nothing calls this directly
no test coverage detected