summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamiro Morales <ramiro@users.noreply.github.com>2020-07-01 11:46:21 -0300
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-07-10 11:38:26 +0200
commit7808a04fe5d84412fce63645c3e773186ab6b67f (patch)
treeddba7b6a8560d4b288b52701b93afafc2e3ab0ef
parentbb47c1dde4fa91a44d1e8729add2f2f26b90c937 (diff)
[3.0.x] Corrected custom model fields how-to.
get_prep_value() method is complementary of from_db_value(). Follow up to e9103402c0fa873aea58a6a11dba510cd308cb84. Backport of 52a0a03671437fc4c1be1eef431685a16aef8b43 from master
-rw-r--r--docs/howto/custom-model-fields.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/howto/custom-model-fields.txt b/docs/howto/custom-model-fields.txt
index 8a8da037f3..9064ea11a5 100644
--- a/docs/howto/custom-model-fields.txt
+++ b/docs/howto/custom-model-fields.txt
@@ -541,8 +541,8 @@ Converting Python objects to query values
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Since using a database requires conversion in both ways, if you override
-:meth:`~Field.to_python` you also have to override :meth:`~Field.get_prep_value`
-to convert Python objects back to query values.
+:meth:`~Field.from_db_value` you also have to override
+:meth:`~Field.get_prep_value` to convert Python objects back to query values.
For example::