django_evolution.utils.apps
Utilities for working with apps.
Functions
|
Return the app with the given label. |
Return the app configuration for an app. |
|
|
Return the label of an app. |
|
Return the name of an app. |
|
Return the list of all installed apps with models. |
|
Return the label of an app. |
Import the management modules for all apps. |
|
|
Register a new app in the registry. |
|
Register one or more models to a given app. |
|
Unregister an app in the registry. |
|
Unregister a model with the given name from the given app. |
- django_evolution.utils.apps.get_apps()
Return the list of all installed apps with models.
Changed in version 3.0: Moved from
django.compat.apps.- Returns:
A list of all the modules containing model classes.
- Return type:
- django_evolution.utils.apps.get_app(app_label, emptyOK=False)
Return the app with the given label.
Changed in version 3.0: Moved from
django.compat.apps.- Parameters:
- Returns:
The app module, if available.
If the app module is available, but the models module is not and
emptyOKis set, this will returnNone. Otherwise, if modules are not available, this will raiseImproperlyConfigured.- Return type:
module- Raises:
django.core.exceptions.ImproperlyConfigured – The app module was not found, or it was found but a models module was not and
emptyOKwasFalse.
- django_evolution.utils.apps.get_app_config_for_app(app)
Return the app configuration for an app.
This can only be called if running on Django 1.7 or higher.
- Parameters:
app (
module) – The app’s models module to return the configuration for. The models module is used for legacy reasons within Django Evolution.- Returns:
The app configuration, or
Noneif it couldn’t be found.- Return type:
- django_evolution.utils.apps.get_app_label(app)
Return the label of an app.
- Parameters:
app (
module) – The app.- Returns:
The label of the app.
- Return type:
- django_evolution.utils.apps.get_app_name(app)
Return the name of an app.
- Parameters:
app (
module) – The app.- Returns:
The name of the app.
- Return type:
- django_evolution.utils.apps.get_legacy_app_label(app)
Return the label of an app.
- Parameters:
app (
module) – The app.- Returns:
The label of the app.
- Return type:
- django_evolution.utils.apps.import_management_modules()
Import the management modules for all apps.
Management modules often contain signal handlers for pre/post syncdb/migrate events. This will import them correctly for the current version of Django.
- Raises:
ImportError – A management module failed to import.
- django_evolution.utils.apps.register_app(app_label, app)
Register a new app in the registry.
This must be balanced with a
unregister_app()call.Changed in version 3.0: Moved from
django.compat.apps.- Parameters:
app_label (
str) – The label of the app.app (
module) – The app module.
- django_evolution.utils.apps.unregister_app(app_label)
Unregister an app in the registry.
This must be balanced with a
register_app()call.Changed in version 3.0: Moved from
django.compat.apps.- Parameters:
app_label (
str) – The label of the app to register.
- django_evolution.utils.apps.register_app_models(app_label, model_infos, reset=False)
Register one or more models to a given app.
These will add onto the list of existing models.
Changed in version 3.0: Moved from
django.compat.apps.
- django_evolution.utils.apps.unregister_app_model(app_label, model_name)
Unregister a model with the given name from the given app.
Changed in version 3.0: Moved from
django.compat.apps.