Daniele Varrazzo
283dbccf56
Merge branch 'range_sort'
2014-02-22 23:02:19 +00:00
Daniele Varrazzo
dd9e476353
Fixed error message on range parsing failed
2014-02-22 23:02:07 +00:00
Daniele Varrazzo
8937c635df
Hardcode the list of attributes to be used in comparison
...
Comparing Range subclasses may lead to surprises.
2014-02-22 21:52:44 +00:00
Daniele Varrazzo
4545d1636c
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 21:51:28 +00:00
Chris Withers
e60266c4c5
New implementation of Range sorting that works for Python 2.5 to 3.3, at least.
2014-02-18 20:55:00 +00:00
Chris Withers
d469c32503
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-12 08:11:59 +00:00
Chris Withers
28276e3eb1
cater for comparison of subclasses
2013-05-26 22:20:07 +01:00
Chris Withers
b6a9e0ffaf
raising an exception here rather than returning False causes problems with SQLAlchemy's internal state tracking
2013-05-26 21:58:39 +01:00
Chris Withers
8bb44f3444
more useful error message when comparing ranges with non-ranges
2013-05-26 21:20:40 +01:00
Daniele Varrazzo
fc2ca0d2e9
Make sure to return a bytes string from numeric range adapter
2013-04-21 20:30:50 +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