diff options
| author | Nick Pope <nick.pope@flightdataservices.com> | 2020-07-16 23:32:46 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-10-02 06:58:03 +0200 |
| commit | 06c5d3fafc6aeb96387148726713b611aeba7fa1 (patch) | |
| tree | 80a366cad2aa8caf22062d6eb5f4487c36a000e2 /docs | |
| parent | f87b0ecd37e64e7a019d472de37d0789a8790f1f (diff) | |
Fixed #32060 -- Added Random database function.
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` --------------------------- |
