django_evolution.placeholders
Placeholder objects for hinted evolutions.
New in version 2.2.
Classes
|
A placeholder object for use in generating hints. |
|
A placeholder for an initial value for a field. |
- class django_evolution.placeholders.BasePlaceholder(app_label=None, model_name=None, field_name=None)
Bases:
object
A placeholder object for use in generating hints.
Placeholder objects provide stand-ins for values that must be hand-added to the evolution file.
New in version 2.2.
- __init__(app_label=None, model_name=None, field_name=None)
Initialize the object.
- __repr__()
Return a string representation of the object.
This is used when outputting the value in a hinted evolution.
- Returns:
The placeholder text.
- Return type:
- __call__()
Handle calls on this object.
This will raise an exception stating that the evolution cannot be performed.
- Raises:
django_evolution.errors.EvolutionException – An error stating that an explicit initial value must be provided in place of this object.
- class django_evolution.placeholders.NullFieldInitialCallback(app_label=None, model_name=None, field_name=None)
Bases:
BasePlaceholder
A placeholder for an initial value for a field.
This is used in place of an initial value in mutations for fields that don’t allow NULL values and don’t have an explicit initial value set. It will show up in hinted evolutions as
<<USER VALUE REQUIRED>>
and will fail to evolve.- __call__()
Handle calls on this object.
This will raise an exception stating that the evolution cannot be performed.
- Raises:
django_evolution.errors.EvolutionException – An error stating that an explicit initial value must be provided in place of this object.