summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql_psycopg2/creation.py
diff options
context:
space:
mode:
authorMarc Tamlyn <marc.tamlyn@gmail.com>2014-07-24 13:57:24 +0100
committerMarc Tamlyn <marc.tamlyn@gmail.com>2014-12-20 18:28:29 +0000
commit57554442fe3e209c135e15dda4ea45123e579e58 (patch)
tree0ef2cb0e3048d13b82e4c7e81192df6124556a44 /django/db/backends/postgresql_psycopg2/creation.py
parenta3d96bee36040975ded8e3bf02e33e48d06f1f16 (diff)
Fixed #2443 -- Added DurationField.
A field for storing periods of time - modeled in Python by timedelta. It is stored in the native interval data type on PostgreSQL and as a bigint of microseconds on other backends. Also includes significant changes to the internals of time related maths in expressions, including the removal of DateModifierNode. Thanks to Tim and Josh in particular for reviews.
Diffstat (limited to 'django/db/backends/postgresql_psycopg2/creation.py')
-rw-r--r--django/db/backends/postgresql_psycopg2/creation.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/django/db/backends/postgresql_psycopg2/creation.py b/django/db/backends/postgresql_psycopg2/creation.py
index 9573107271..45ce939165 100644
--- a/django/db/backends/postgresql_psycopg2/creation.py
+++ b/django/db/backends/postgresql_psycopg2/creation.py
@@ -16,6 +16,7 @@ class DatabaseCreation(BaseDatabaseCreation):
'DateField': 'date',
'DateTimeField': 'timestamp with time zone',
'DecimalField': 'numeric(%(max_digits)s, %(decimal_places)s)',
+ 'DurationField': 'interval',
'FileField': 'varchar(%(max_length)s)',
'FilePathField': 'varchar(%(max_length)s)',
'FloatField': 'double precision',