class documentation

class RenameField(FieldOperation): (source)

View In Hierarchy

Rename a field on the model. Might affect db_column too.

Method __init__ Undocumented
Method database_backwards Perform the mutation on the database schema in the reverse direction - e.g. if this were CreateModel, it would in fact drop the model's table.
Method database_forwards Perform the mutation on the database schema in the normal (forwards) direction.
Method deconstruct Return a 3-tuple of class import path (or just name if it lives under django.db.migrations), positional arguments, and keyword arguments.
Method describe Output a brief summary of what the action does.
Method reduce Return either a list of operations the actual operation should be replaced with or a boolean that indicates whether or not the specified operation can be optimized across.
Method references_field Return True if there is a chance this operation references the given field name, with an app label for accuracy.
Method state_forwards Take the state from the previous migration, and mutate it so that it matches what this migration would perform.
Instance Variable new_name Undocumented
Instance Variable old_name Undocumented
Property migration_name_fragment A filename part suitable for automatically naming a migration containing this operation, or None if not applicable.
Property new_name_lower Undocumented
Property old_name_lower Undocumented

Inherited from FieldOperation:

Method is_same_field_operation Undocumented
Method is_same_model_operation Undocumented
Method references_model Return True if there is a chance this operation references the given model name (as a string), with an app label for accuracy.
Instance Variable field Undocumented
Instance Variable model_name Undocumented
Instance Variable name Undocumented
Property model_name_lower Undocumented
Property name_lower Undocumented

Inherited from Operation (via FieldOperation):

Method __new__ Undocumented
Method __repr__ Undocumented
Method allow_migrate_model Return whether or not a model may be migrated.
Class Variable atomic Undocumented
Class Variable elidable Undocumented
Class Variable reduces_to_sql Undocumented
Class Variable reversible Undocumented
Class Variable serialization_expand_args Undocumented
Instance Variable _constructor_args Undocumented
def __init__(self, model_name, old_name, new_name): (source)
def database_backwards(self, app_label, schema_editor, from_state, to_state): (source)

Perform the mutation on the database schema in the reverse direction - e.g. if this were CreateModel, it would in fact drop the model's table.

def database_forwards(self, app_label, schema_editor, from_state, to_state): (source)

Perform the mutation on the database schema in the normal (forwards) direction.

def deconstruct(self): (source)

Return a 3-tuple of class import path (or just name if it lives under django.db.migrations), positional arguments, and keyword arguments.

def describe(self): (source)

Output a brief summary of what the action does.

def reduce(self, operation, app_label): (source)

Return either a list of operations the actual operation should be replaced with or a boolean that indicates whether or not the specified operation can be optimized across.

def references_field(self, model_name, name, app_label): (source)

Return True if there is a chance this operation references the given field name, with an app label for accuracy. Used for optimization. If in doubt, return True.

def state_forwards(self, app_label, state): (source)

Take the state from the previous migration, and mutate it so that it matches what this migration would perform.

new_name = (source)

Undocumented

old_name = (source)

Undocumented

@property
migration_name_fragment = (source)

A filename part suitable for automatically naming a migration containing this operation, or None if not applicable.

@cached_property
new_name_lower = (source)

Undocumented

@cached_property
old_name_lower = (source)

Undocumented