diff options
| author | Markus Holtermann <info@markusholtermann.eu> | 2014-12-12 23:19:58 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-12-15 08:34:15 -0500 |
| commit | aa5ef0d4fc67a95ac2a5103810d0c87d8c547bac (patch) | |
| tree | 74bd11b3ef733268da4d59019e80c47752fc37c8 /docs/ref | |
| parent | e37ab311fc52ff5c9ea0951ce3a8d8b38f285900 (diff) | |
Fixed #23822 -- Added support for serializing model managers in migration
Thanks to Shai Berger, Loïc Bistuer, Simon Charette, Andrew Godwin,
Tim Graham, Carl Meyer, and others for their review and input.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/migration-operations.txt | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/docs/ref/migration-operations.txt b/docs/ref/migration-operations.txt index ef5f2a44d9..4055c4f828 100644 --- a/docs/ref/migration-operations.txt +++ b/docs/ref/migration-operations.txt @@ -37,7 +37,7 @@ Schema Operations CreateModel ----------- -.. class:: CreateModel(name, fields, options=None, bases=None) +.. class:: CreateModel(name, fields, options=None, bases=None, managers=None) Creates a new model in the project history and a corresponding table in the database to match it. @@ -56,6 +56,14 @@ it can contain both class objects as well as strings in the format from the historical version). If it's not supplied, it defaults to just inheriting from the standard ``models.Model``. +``managers`` takes a list of 2-tuples of ``(manager_name, manager_instance)``. +The first manager in the list will be the default manager for this model during +migrations. + +.. versionchanged:: 1.8 + + The ``managers`` argument was added. + DeleteModel ----------- @@ -121,6 +129,15 @@ like ``permissions`` and ``verbose_name``. Does not affect the database, but persists these changes for :class:`RunPython` instances to use. ``options`` should be a dictionary mapping option names to values. +AlterModelManagers +------------------ + +.. versionadded:: 1.8 + +.. class:: AlterModelManagers(name, managers) + +Alters the managers that are available during migrations. + AddField -------- |
