diff options
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/contrib/postgres/functions.txt | 20 | ||||
| -rw-r--r-- | docs/ref/contrib/postgres/operations.txt | 9 |
2 files changed, 29 insertions, 0 deletions
diff --git a/docs/ref/contrib/postgres/functions.txt b/docs/ref/contrib/postgres/functions.txt index 465d423f6d..8d3df51864 100644 --- a/docs/ref/contrib/postgres/functions.txt +++ b/docs/ref/contrib/postgres/functions.txt @@ -7,6 +7,26 @@ All of these functions are available from the .. currentmodule:: django.contrib.postgres.functions +``RandomUUID`` +============== + +.. class:: RandomUUID() + +.. versionadded:: 2.0 + +Returns a version 4 UUID. + +The `pgcrypto extension`_ must be installed. You can use the +:class:`~django.contrib.postgres.operations.CryptoExtension` migration +operation to install it. + +.. _pgcrypto extension: https://www.postgresql.org/docs/current/static/pgcrypto.html + +Usage example:: + + >>> from django.contrib.postgres.functions import RandomUUID + >>> Article.objects.update(uuid=RandomUUID()) + ``TransactionNow`` ================== diff --git a/docs/ref/contrib/postgres/operations.txt b/docs/ref/contrib/postgres/operations.txt index 90cd007121..d984d9a3f7 100644 --- a/docs/ref/contrib/postgres/operations.txt +++ b/docs/ref/contrib/postgres/operations.txt @@ -67,6 +67,15 @@ run the query ``CREATE EXTENSION IF NOT EXISTS hstore;``. Installs the ``citext`` extension. +``CryptoExtension`` +=================== + +.. class:: CryptoExtension() + + .. versionadded:: 2.0 + + Installs the ``pgcrypto`` extension. + ``HStoreExtension`` =================== |
