From fcb5dbfec0542faaa1b0adad754a1caf1bcd65e2 Mon Sep 17 00:00:00 2001 From: Paolo Melchiorre Date: Wed, 29 Mar 2017 23:52:42 +0200 Subject: Fixed #27996 -- Added RandomUUID function and CryptoExtension to contrib.postgres. --- docs/ref/contrib/postgres/functions.txt | 20 ++++++++++++++++++++ docs/ref/contrib/postgres/operations.txt | 9 +++++++++ 2 files changed, 29 insertions(+) (limited to 'docs/ref') 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`` =================== -- cgit v1.3