diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-08-18 01:00:44 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-08-18 01:00:44 +0000 |
| commit | 820346549b7e50e927c519c9bc54934e9a440422 (patch) | |
| tree | 1747619176907dac7663f54408a4288129e49a3a /lib/sqlalchemy/operators.py | |
| parent | 74595d900c23fcefe75353d3099cb73a55a0b6cf (diff) | |
| download | sqlalchemy-820346549b7e50e927c519c9bc54934e9a440422.tar.gz | |
- modified SQL operator functions to be module-level operators, allowing
SQL expressions to be pickleable [ticket:735]
- small adjustment to mapper class.__init__ to allow for Py2.6 object.__init__()
behavior
Diffstat (limited to 'lib/sqlalchemy/operators.py')
| -rw-r--r-- | lib/sqlalchemy/operators.py | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/lib/sqlalchemy/operators.py b/lib/sqlalchemy/operators.py new file mode 100644 index 000000000..b8aca3d26 --- /dev/null +++ b/lib/sqlalchemy/operators.py @@ -0,0 +1,61 @@ +"""define opeators used in SQL expressions""" + +from operator import and_, or_, inv, add, mul, sub, div, mod, truediv, lt, le, ne, gt, ge, eq + +def from_(): + raise NotImplementedError() + +def as_(): + raise NotImplementedError() + +def exists(): + raise NotImplementedError() + +def is_(): + raise NotImplementedError() + +def isnot(): + raise NotImplementedError() + +def like_op(a, b): + return a.like(b) + +def notlike_op(a, b): + raise NotImplementedError() + +def ilike_op(a, b): + return a.ilike(b) + +def notilike_op(a, b): + raise NotImplementedError() + +def between_op(a, b): + return a.between(b) + +def in_op(a, b): + return a.in_(*b) + +def notin_op(a, b): + raise NotImplementedError() + +def distinct_op(a): + return a.distinct() + +def startswith_op(a, b): + return a.startswith(b) + +def endswith_op(a, b): + return a.endswith(b) + +def comma_op(a, b): + raise NotImplementedError() + +def concat_op(a, b): + return a.concat(b) + +def desc_op(a): + return a.desc() + +def asc_op(a): + return a.asc() + |
