diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/database-functions.txt | 9 | ||||
| -rw-r--r-- | docs/releases/3.2.txt | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/docs/ref/models/database-functions.txt b/docs/ref/models/database-functions.txt index 3121a36fa9..5d13f47879 100644 --- a/docs/ref/models/database-functions.txt +++ b/docs/ref/models/database-functions.txt @@ -1114,6 +1114,15 @@ It can also be registered as a transform. For example:: >>> # Get vectors whose radians are less than 1 >>> vectors = Vector.objects.filter(x__radians__lt=1, y__radians__lt=1) +``Random`` +---------- + +.. class:: Random(**extra) + +.. versionadded:: 3.2 + +Returns a random value in the range ``0.0 ≤ x < 1.0``. + ``Round`` --------- diff --git a/docs/releases/3.2.txt b/docs/releases/3.2.txt index ec78dd863a..4987423ff3 100644 --- a/docs/releases/3.2.txt +++ b/docs/releases/3.2.txt @@ -314,6 +314,8 @@ Models :attr:`TextField <django.db.models.TextField.db_collation>` allows setting a database collation for the field. +* Added the :class:`~django.db.models.functions.Random` database function. + Pagination ~~~~~~~~~~ @@ -444,6 +446,9 @@ backends. non-deterministic collations are not supported, set ``supports_non_deterministic_collations`` to ``False``. +* ``DatabaseOperations.random_function_sql()`` is removed in favor of the new + :class:`~django.db.models.functions.Random` database function. + :mod:`django.contrib.admin` --------------------------- |
