Add docs for range type operator argument coercion

This commit is contained in:
Konsta Vesterinen
2014-01-14 17:03:10 +02:00
parent e236596cc4
commit 3c7d25d6f6

View File

@@ -16,12 +16,33 @@ Some good reading for practical interval implementations:
http://wiki.postgresql.org/images/f/f0/Range-types.pdf
RangeType operators
-------------------
Range type operators
--------------------
SQLAlchemy-Utils supports many range type operators. These operators follow the `intervals` package interval coercion rules.
So for example when we make a query such as:
::
session.query(Car).filter(Car.price_range == 300)
It is essentially the same as:
::
session.query(Car).filter(Car.price_range == DecimalInterval([300, 300]))
The coercion is provided for convenience.
Comparison operators
^^^^^^^^^^^^^^^^^^^^
All range types support all comparison operators (>, >=, ==, !=, <=, <).
::
Car.price_range < [12, 300]