Fixed #22497 -- Highlighted difference between field and class deconstruction.

Thanks nliberg for the suggestion.
This commit is contained in:
Tim Graham 2014-04-28 08:18:43 -04:00
parent 1ce759b69f
commit b829d53b37
2 changed files with 19 additions and 13 deletions

View file

@ -502,8 +502,10 @@ Adding a deconstruct() method
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can let Django serialize your own custom class instances by giving the class
a ``deconstruct`` method. It takes no arguments, and should return a tuple
of 3 things: ``(path, args, kwargs)``.
a ``deconstruct()`` method. It takes no arguments, and should return a tuple
of three things: ``(path, args, kwargs)``. Note this return value is different
from the ``deconstruct()`` method :ref:`for custom fields
<custom-field-deconstruct-method>` which returns a tuple of four items.
``path`` should be the Python path to the class, with the class name included as the
last part (for example, ``myapp.custom_things.MyClass``). If your class is not