summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-07-06 13:18:05 -0400
committerTim Graham <timograham@gmail.com>2017-07-20 16:30:08 -0400
commit487362fa8f23d41de4db58e7408e66eb36399af0 (patch)
tree25897a03c885d44a15860f59c121f0b6fab3e4a8 /docs
parent8d5095d8a33824e02c95ee44d6e5acdb4b39e7ed (diff)
Fixed #28370 -- Deprecated the context arg of Field.from_db_value() and Expression.convert_value().
Unused since a0d166306fbdc41f49e6fadf4ec84b17eb147daa.
Diffstat (limited to 'docs')
-rw-r--r--docs/howto/custom-model-fields.txt2
-rw-r--r--docs/internals/deprecation.txt3
-rw-r--r--docs/ref/models/expressions.txt2
-rw-r--r--docs/ref/models/fields.txt2
-rw-r--r--docs/releases/2.0.txt16
5 files changed, 22 insertions, 3 deletions
diff --git a/docs/howto/custom-model-fields.txt b/docs/howto/custom-model-fields.txt
index d7ad9562a5..8ecfee8709 100644
--- a/docs/howto/custom-model-fields.txt
+++ b/docs/howto/custom-model-fields.txt
@@ -512,7 +512,7 @@ instances::
class HandField(models.Field):
# ...
- def from_db_value(self, value, expression, connection, context):
+ def from_db_value(self, value, expression, connection):
if value is None:
return value
return parse_hand(value)
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt
index cee80fdbe2..c41245ac65 100644
--- a/docs/internals/deprecation.txt
+++ b/docs/internals/deprecation.txt
@@ -23,6 +23,9 @@ details on these changes.
* ``HttpRequest.xreadlines()`` will be removed.
+* Support for the ``context`` argument of ``Field.from_db_value()`` and
+ ``Expression.convert_value()`` will be removed.
+
.. _deprecation-removed-in-2.1:
2.1
diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt
index 46dd5ecdd3..361b170412 100644
--- a/docs/ref/models/expressions.txt
+++ b/docs/ref/models/expressions.txt
@@ -714,7 +714,7 @@ calling the appropriate methods on the wrapped expression.
clone.expression = self.expression.relabeled_clone(change_map)
return clone
- .. method:: convert_value(value, expression, connection, context)
+ .. method:: convert_value(value, expression, connection)
A hook allowing the expression to coerce ``value`` into a more
appropriate type.
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt
index e9e601e5c7..90c64539f5 100644
--- a/docs/ref/models/fields.txt
+++ b/docs/ref/models/fields.txt
@@ -1797,7 +1797,7 @@ Field API reference
When loading data, :meth:`from_db_value` is used:
- .. method:: from_db_value(value, expression, connection, context)
+ .. method:: from_db_value(value, expression, connection)
Converts a value as returned by the database to a Python object. It is
the reverse of :meth:`get_prep_value`.
diff --git a/docs/releases/2.0.txt b/docs/releases/2.0.txt
index d90b80124d..16024ae244 100644
--- a/docs/releases/2.0.txt
+++ b/docs/releases/2.0.txt
@@ -564,6 +564,22 @@ Miscellaneous
Features deprecated in 2.0
==========================
+``context`` argument of ``Field.from_db_value()`` and ``Expression.convert_value()``
+------------------------------------------------------------------------------------
+
+The ``context`` argument of ``Field.from_db_value()`` and
+``Expression.convert_value()`` is unused as it's always an empty dictionary.
+The signature of both methods is now::
+
+ (self, value, expression, connection)
+
+instead of::
+
+ (self, value, expression, connection, context)
+
+Support for the old signature in custom fields and expressions remains until
+Django 3.0.
+
Miscellaneous
-------------