django_evolution.mutations.rename_app_label
Mutation that renames the app label for an application.
New in version 2.2.
Classes
|
A mutation that renames the app label for an application. |
- class django_evolution.mutations.rename_app_label.RenameAppLabel(old_app_label, new_app_label, legacy_app_label=None, model_names=None)
Bases:
BaseMutation
A mutation that renames the app label for an application.
Changed in version 2.2: Moved into the
django_evolution.mutations.rename_app_label
module.- __init__(old_app_label, new_app_label, legacy_app_label=None, model_names=None)
- get_hint_params()
Return parameters for the mutation’s hinted evolution.
- is_mutable(app_label, project_sig, database_state, database)
Return whether the mutation can be applied to the database.
- Parameters:
app_label (
unicode
) – The label for the Django application to be mutated.project_sig (
dict
, unused) – The project’s schema signature.database_state (
django_evolution.db.state.DatabaseState
, unused) – The database state.database (
unicode
) – The name of the database the operation would be performed on.
- Returns:
True
if the mutation can run.False
if it cannot.- Return type:
- simulate(simulation)
Simulate the mutation.
This will alter the signature to make any changes needed for the application’s evolution storage.
- mutate(mutator)
Schedule an app mutation on the mutator.
This will inform the mutator of the new app label, for use in any future operations.
- Parameters:
mutator (
django_evolution.mutators.AppMutator
) – The mutator to perform an operation on.