Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

sqlalchemy filter getattr

q = session.query(myClass)
for attr, value in web_dict.items():
    q = q.filter(getattr(myClass, attr).like("%%%s%%" % value))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sqlalchemy #filter #getattr
ADD COMMENT
Topic
Name
7+2 =