summaryrefslogtreecommitdiff
path: root/docs
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
parent98ee57e343206ef553de78b22be5e9a6dacb5060 (diff)
Fixed #27996 -- Added RandomUUID function and CryptoExtension to contrib.postgres.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/postgres/functions.txt20
-rw-r--r--docs/ref/contrib/postgres/operations.txt9
-rw-r--r--docs/releases/2.0.txt6
3 files changed, 35 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``
===================
diff --git a/docs/releases/2.0.txt b/docs/releases/2.0.txt
index 4babd84773..cc1248a9b0 100644
--- a/docs/releases/2.0.txt
+++ b/docs/releases/2.0.txt
@@ -87,6 +87,12 @@ Minor features
:class:`~django.contrib.postgres.aggregates.ArrayAgg` determines if
concatenated values will be distinct.
+* The new :class:`~django.contrib.postgres.functions.RandomUUID` database
+ function returns a version 4 UUID. It requires use of PostgreSQL's
+ ``pgcrypto`` extension which can be activated using the new
+ :class:`~django.contrib.postgres.operations.CryptoExtension` migration
+ operation.
+
:mod:`django.contrib.redirects`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~