Thing: Add not_ operator.

This commit is contained in:
bsimpson63
2012-11-18 13:06:45 -05:00
parent c9f972f113
commit b9afde3e1a
2 changed files with 3 additions and 0 deletions

View File

@@ -29,6 +29,7 @@ class BooleanOp(object):
class or_(BooleanOp): pass
class and_(BooleanOp): pass
class not_(BooleanOp): pass
class op(object):
def __init__(self, lval, lval_name, rval):

View File

@@ -710,6 +710,8 @@ def sa_op(op):
return sa.or_(*[sa_op(o) for o in op.ops])
elif isinstance(op, operators.and_):
return sa.and_(*[sa_op(o) for o in op.ops])
elif isinstance(op, operators.not_):
return sa.not_(*[sa_op(o) for o in op.ops])
#else, assume op is an instance of op
if isinstance(op, operators.eq):