Add an extra warning about custom save methods in migrations docs.

This commit is contained in:
Andrew Godwin 2014-01-28 14:10:40 +00:00
parent 2b6914049a
commit 5dc4a8652c
1 changed files with 6 additions and 0 deletions

View File

@ -298,6 +298,12 @@ models will not have any custom methods or managers that you have defined.
They will, however, have the same fields, relationships and ``Meta`` options They will, however, have the same fields, relationships and ``Meta`` options
(also versioned, so they may be different from your current ones). (also versioned, so they may be different from your current ones).
.. warning::
This means that you will NOT have custom save() methods called on objects
when you access them in migrations, and you will NOT have any custom constructors
or instance methods. Plan appropriately!
In addition, the base classes of the model are just stored as pointers, In addition, the base classes of the model are just stored as pointers,
so you must always keep base classes around for as long as there is a migration so you must always keep base classes around for as long as there is a migration
that contains a reference to them. On the plus side, methods and managers that contains a reference to them. On the plus side, methods and managers