Source code django/contrib/postgres/functions.py

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
from django.db.models import DateTimeField, Func, UUIDField


class RandomUUID(Func):
    template = 'GEN_RANDOM_UUID()'
    output_field = UUIDField()


class TransactionNow(Func):
    template = 'CURRENT_TIMESTAMP'
    output_field = DateTimeField()