summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAdam Chainz <adam@adamj.eu>2015-05-29 15:54:10 +0100
committerTim Graham <timograham@gmail.com>2015-06-02 17:59:01 -0400
commit23048d186ce0041654a9f547fe3e7177efce3076 (patch)
tree931a4f7448be40aac015389a7255fb8d9042e891 /docs
parent002b3d87b5f1e35edcb6e14ce2e2827fc6c032a1 (diff)
Fixed #24866 -- Added Now() database function
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/database-functions.txt15
-rw-r--r--docs/releases/1.9.txt3
2 files changed, 18 insertions, 0 deletions
diff --git a/docs/ref/models/database-functions.txt b/docs/ref/models/database-functions.txt
index cdd46ff1a2..b797e5f1df 100644
--- a/docs/ref/models/database-functions.txt
+++ b/docs/ref/models/database-functions.txt
@@ -117,6 +117,21 @@ Usage example::
>>> print(author.name_lower)
margaret smith
+Now
+---
+
+.. class:: Now()
+
+.. versionadded:: 1.9
+
+Returns the database server's current date and time when the query is executed.
+
+Usage example::
+
+ >>> from django.db.models.functions import Now
+ >>> Article.objects.filter(published__lte=Now())
+ [<Article: How to Django>]
+
Substr
------
diff --git a/docs/releases/1.9.txt b/docs/releases/1.9.txt
index bca086b207..192da111c2 100644
--- a/docs/releases/1.9.txt
+++ b/docs/releases/1.9.txt
@@ -240,6 +240,9 @@ Models
* Added the :lookup:`date` lookup to :class:`~django.db.models.DateTimeField`
to allow querying the field by only the date portion.
+* Added the :class:`~django.db.models.functions.Now` database function, which
+ returns the current date and time.
+
CSRF
^^^^