Fixed #24793 -- Unified temporal difference support.

This commit is contained in:
Simon Charette 2016-01-19 20:43:41 -05:00
parent 31098e3288
commit 766afc22a1
14 changed files with 135 additions and 2 deletions

View file

@ -590,3 +590,10 @@ class BaseDatabaseOperations(object):
range of the column type bound to the field.
"""
return self.integer_field_ranges[internal_type]
def subtract_temporals(self, internal_type, lhs, rhs):
if self.connection.features.supports_temporal_subtraction:
lhs_sql, lhs_params = lhs
rhs_sql, rhs_params = rhs
return "(%s - %s)" % (lhs_sql, rhs_sql), lhs_params + rhs_params
raise NotImplementedError("This backend does not support %s subtraction." % internal_type)