summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorPaolo Melchiorre <paolo@melchiorre.org>2017-03-29 23:52:42 +0200
committerTim Graham <timograham@gmail.com>2017-04-25 20:21:36 -0400
commitfcb5dbfec0542faaa1b0adad754a1caf1bcd65e2 (patch)
treea81d7f63382578206e943e539165fecf43c00e64 /docs/ref
parent98ee57e343206ef553de78b22be5e9a6dacb5060 (diff)
Fixed #27996 -- Added RandomUUID function and CryptoExtension to contrib.postgres.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/postgres/functions.txt20
-rw-r--r--docs/ref/contrib/postgres/operations.txt9
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``
===================