I\'m not quite sure what I mean here, so please bear with me..
In SQLAlchemy, it appears I\'m supposed to pass an expression to filter() in certain cases. When I try to
You have to implement __eq__()
. For example ::
class A(object):
def __eq__(self, other):
return (self, '==', other)
Then, for the function, which you want to get the expression, like ::
def my_func(expr):
# deal with the expression
print(expr)
>>> a = A()
>>> my_func(a == 1)
(<__main__.A object at 0x1015eb978>, '==', 1)