Hi All,

I am trying to do query based on the user input as follows

condition = 'and_(db.User.id == id'
if user_name != ' ':
    condition += ',db.User.name == user_name'
elif age != ' ':
    condition += ',db.User.age == age'
elif place != ' ':
    condition += ',db.User.place == place'

where = condition+')'

result = db.User.filter(where).all()


But Im getting error when i do this.

Is there any way by which i can do this


Thank you
   Sana

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to