Feidhmeanna bunachar sonraí sonracha PostgreSQLLink to this heading

Tá na feidhmeanna seo go léir ar fáil ón modúl django.contrib.postgres.functions.

RandamuuidLink to this heading

class RandomUUIDLink to this definition

Tugann leagan 4 UUID ar ais.

Sampla úsáide:

Python console
>>> from django.contrib.postgres.functions import RandomUUID
>>> Article.objects.update(uuid=RandomUUID())

``Idirghníomhaíochtaí Anois ``Link to this heading

class TransactionNowLink to this definition

Tugann sé an dáta agus an t-am ar an bhfreastalaí bunachar sonraí a thosaigh an t-idirbheart reatha. Mura bhfuil tú i idirbheart, cuirfidh sé dáta agus am an ráiteas reatha ar ais. Is comhlánú é seo la:class: Django.db.Models.Functions.Now, a thugann dáta agus am an ráiteas reatha ar ais.

Note that only the outermost call to atomic() sets up a transaction and thus sets the time that TransactionNow() will return; nested calls create savepoints which do not affect the transaction time.

Sampla úsáide:

Python console
>>> from django.contrib.postgres.functions import TransactionNow
>>> Article.objects.filter(published__lte=TransactionNow())
<QuerySet [<Article: How to Django>]>