Kaydet (Commit) 4cef9a09 authored tarafından Tim Graham's avatar Tim Graham

Fixed #17388 - Noted in the custom model field docs that field methods need to…

Fixed #17388 - Noted in the custom model field docs that field methods need to handle None if the field may be null.
üst 0b908b92
......@@ -448,6 +448,13 @@ called when it is created, you should be using `The SubfieldBase metaclass`_
mentioned earlier. Otherwise :meth:`.to_python` won't be called
automatically.
.. warning::
If your custom field allows ``null=True``, any field method that takes
``value`` as an argument, like :meth:`~Field.to_python` and
:meth:`~Field.get_prep_value`, should handle the case when ``value`` is
``None``.
Converting Python objects to query values
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment