LibraryActive

Django Migration Operations

Declarative Operation classes that record schema and data changes in Django migration files.

Open source page

Product features

Product features

AddField

Adds a field to a model; preserve_default controls whether the default is permanent.

AlterField

Changes a field's definition on a model.

Built-in template context processors ¶

Built-in variables ¶

Configuring an engine ¶

CreateModel

Creates a new model in project history and a matching database table.

DeleteModel

Deletes the model from project history and its table from the database.

How invalid variables are handled ¶

Limitations with string literals ¶

Loading a template ¶

Overview ¶

Playing with Context objects ¶

RemoveField

Removes a field from a model.

RenameModel

Renames a model from an old name to a new one.

Rendering a context ¶

RunPython

Special operation for running Python code as a data migration.

RunSQL

Special operation for running raw SQL in a migration.

The Django template language: for Python programmers ¶

Using RequestContext ¶

Variables and lookups ¶