Commit Graph

21 Commits

Author SHA1 Message Date
Daniele Varrazzo
6c27cdd20e Hardcode the list of attributes to be used in comparison
Comparing Range subclasses may lead to surprises.
2014-02-22 23:06:02 +00:00
Daniele Varrazzo
c10c1186a5 Added implementation for Range gt and ge operators
Using a common implementation for all the operators. Note that lt is the
one used by sort so it's nice it's the fastest.
2014-02-22 23:06:02 +00:00
Chris Withers
1487800b6d New implementation of Range sorting that works for Python 2.5 to 3.3, at least. 2014-02-22 23:06:02 +00:00
Chris Withers
f739576f0a Provide a stable and consistent sort order for Range objects.
This matches postgres server-side behaviour and helps client applications that need to sort based on the primary key of tables where the primary key is or contains a range.
2014-02-22 23:06:02 +00:00
Daniele Varrazzo
434fbb02b1 Fixed error message on range parsing failed 2014-02-19 01:03:01 +00:00
Daniele Varrazzo
eb36e75b89 Fixed comparison of Range with non-range objects
Fixes ticket #164.

Patch from Chris Withers on master.
2013-06-18 14:16:06 +01:00
Daniele Varrazzo
b8fbe599ac Make sure to return a bytes string from numeric range adapter 2013-04-21 20:30:03 +01:00
Daniele Varrazzo
884a7f7db6 A couple of typos fixed 2013-04-07 16:05:36 +01:00
Daniele Varrazzo
06bfa801f4 Fixed range adaptation on Python 3 2013-03-16 22:12:41 +00:00
Daniele Varrazzo
b8b669611e More helpful error messasge on Range order attempts 2012-09-25 00:07:08 +01:00
Daniele Varrazzo
c756d580f2 Added documentation for range types and adaptation 2012-09-24 00:49:44 +01:00
Daniele Varrazzo
b1953640d2 Don't need to implement __new__ to make an immutable class 2012-09-24 00:49:02 +01:00
Daniele Varrazzo
a858987844 Fixed search of types into schemas.
We don't need to look for stuff implicitly into pg_catalog as all
the builtin ranges are already registered. So just search into
'public' if the schema is not specified.
2012-09-24 00:49:02 +01:00
Daniele Varrazzo
841ddaba87 Range objects cannot be ordered 2012-09-23 22:54:50 +01:00
Daniele Varrazzo
25ef540aa3 Range objects are nonzero when not empty 2012-09-23 22:43:23 +01:00
Daniele Varrazzo
a96a4349ed Range objects are immutable and hashable 2012-09-23 22:40:13 +01:00
Daniele Varrazzo
e002ea5937 Dropped Range._empty attribute
We can do with just _bounds: it will make eq and hash easier to
implement in a consistent way
2012-09-23 22:10:33 +01:00
Daniele Varrazzo
d2cee6f9ad Added in operator for ranges 2012-09-23 22:01:39 +01:00
Daniele Varrazzo
94c6353d55 NumberRange renamed to NumericRange
I was avoiding Numeric to avoid conflicting with the 'numeric'
Postgres type, which is an alias for 'decimal'. But now that there
is a single numeric range I can use the preferred name
2012-09-23 21:11:06 +01:00
Daniele Varrazzo
45cbcc0713 Dropped Range classes for specific numeric types 2012-09-23 21:08:18 +01:00
Daniele Varrazzo
5e7c1d0b51 Added first implementation of Range type, adapter, typecaster 2012-09-23 21:03:36 +01:00