summaryrefslogtreecommitdiff
path: root/django/db/backends/__init__.py
diff options
context:
space:
mode:
authorMarc Tamlyn <marc.tamlyn@gmail.com>2014-12-21 14:36:37 +0000
committerMarc Tamlyn <marc.tamlyn@gmail.com>2014-12-23 10:38:32 +0000
commit5ca82e710e2f92b8c5114492205c8764918407d3 (patch)
tree47fe9f6501c2b93c164ff866b2945a0b4d3f8153 /django/db/backends/__init__.py
parent803947161b2296a1c71b9cb7822c469a5fffef04 (diff)
Fixed #24033 -- Use interval type on Oracle.
Use INTERVAL DAY(9) TO SECOND(6) for Durationfield on Oracle rather than storing as a NUMBER(19) of microseconds. There are issues with cx_Oracle which require some extra data manipulation in the database backend when constructing queries, but it handles the conversion back to timedelta objects cleanly. Thanks to Shai for the review.
Diffstat (limited to 'django/db/backends/__init__.py')
-rw-r--r--django/db/backends/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py
index 104744b220..eb70ad9861 100644
--- a/django/db/backends/__init__.py
+++ b/django/db/backends/__init__.py
@@ -580,6 +580,12 @@ class BaseDatabaseFeatures(object):
# Is there a true datatype for timedeltas?
has_native_duration_field = False
+ # Does the database driver support timedeltas as arguments?
+ # This is only relevant when there is a native duration field.
+ # Specifically, there is a bug with cx_Oracle:
+ # https://bitbucket.org/anthony_tuininga/cx_oracle/issue/7/
+ driver_supports_timedelta_args = False
+
# Do time/datetime fields have microsecond precision?
supports_microsecond_precision = True