Ticket #30621: ranges.diff
File ranges.diff, 713 bytes (added by , 5 years ago) |
---|
-
ranges.py
old new 170 170 params = lhs_params + rhs_params 171 171 # Cast the rhs if needed. 172 172 cast_sql = '' 173 if isinstance(self.rhs, models.Expression) and self.rhs._output_field_or_none :173 if isinstance(self.rhs, models.Expression) and self.rhs._output_field_or_none and not isinstance(self.rhs.output_field, (DateRangeField, DateTimeRangeField)): 174 174 cast_internal_type = self.lhs.output_field.base_field.get_internal_type() 175 175 cast_sql = '::{}'.format(connection.data_types.get(cast_internal_type)) 176 176 return '%s @> %s%s' % (lhs, rhs, cast_sql), params