mirror of
https://github.com/django/django.git
synced 2025-08-01 09:32:50 +00:00
Fixed #24793 -- Unified temporal difference support.
This commit is contained in:
parent
31098e3288
commit
766afc22a1
14 changed files with 135 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue