- changed status to resolved
contains() got an unexpected keyword argument 'escape'
Issue #1130
resolved
Hi,
Sorry for not including a ''complete, working test case''. I tried the following code:
from sqlalchemy.sql.operators import *
from myprogram.config.model import Session
from myprogram.plugins.base.model import Organization
from myprogram.plugins.base.model.organization import Organization
q = Session.query(Organization)
q.filter(contains_op(Organization.name, 'ix'))
and the traceback was:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.0beta3-py2.5.egg/sqlalchemy/sql/operators.py", line 64, in contains_op
return a.contains(b, escape=escape)
TypeError: contains() got an unexpected keyword argument 'escape'
I fixed it by removing the ''escape'' argument from the call.
Comments (3)
-
repo owner -
Account Deleted Replying to zzzeek:
much easier to just call
Organization.name.contains('ix')
- the ops inoperators
weren't designed for public consumption.escape
is an actual feature of this operator. tweak in cdd673f2e4bbacbb077d00a2e79eafa05abecc35.Thank you very much for your comments.
Nikos.
-
repo owner - removed milestone
Removing milestone: 0.5.0 (automated comment)
- Log in to comment
much easier to just call
Organization.name.contains('ix')
- the ops inoperators
weren't designed for public consumption.escape
is an actual feature of this operator. tweak in cdd673f2e4bbacbb077d00a2e79eafa05abecc35.