Changes between Version 1 and Version 2 of Ticket #27147, comment 8


Ignore:
Timestamp:
Aug 1, 2018, 8:27:29 AM (6 years ago)
Author:
Jakub Skałecki

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27147, comment 8

    v1 v2  
    1818        def from_db_value(self, value, expression, connection):
    1919            # we're checking if bounds differ from default value
    20             # it's needed, because psycopg2 always returns Range with '[)' bounds
    21             if self.bounds[0] == '(':
    22                 value._lower = value._lower - unit_diff
    23             if self.bounds[1] == ']':
    24                 value._upper = value._upper - unit_diff
     20            if self.bounds[0] == '(' and value.lower:
     21                value._lower = value.lower - unit_diff
     22            if self.bounds[1] == ']' and value.upper:
     23                value._upper = value.upper - unit_diff
    2524            value._bounds = self.bounds
    2625            return value
Back to Top