From 52a0a03671437fc4c1be1eef431685a16aef8b43 Mon Sep 17 00:00:00 2001 From: Ramiro Morales Date: Wed, 1 Jul 2020 11:46:21 -0300 Subject: [PATCH] Corrected custom model fields how-to. get_prep_value() method is complementary of from_db_value(). Follow up to e9103402c0fa873aea58a6a11dba510cd308cb84. --- docs/howto/custom-model-fields.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/howto/custom-model-fields.txt b/docs/howto/custom-model-fields.txt index c31a5dbc4f8..2572b2ed39f 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::