1

I have table name VenueSetting

id  prefix  type
------------------
1   456     1
2   8       2
3   4560    3

how to query on a input number to get matched the prefix in database using SqlAchemy ORM query, a version of like in reverse

something like this query

from_phone = '456789000'
session.query(VenueSetting).
         filter(from_phone.like(VenueSetting.prefix + '%')).
         first()

#expect result is record with id=1 in database
Hardy
  • 1,499
  • 2
  • 26
  • 39
  • 1
    It seems you have the same question with this one: http://stackoverflow.com/questions/13176252/python-startswith-equivalent-for-sqlalchemy – Leon Young Sep 19 '13 at 06:21

0 Answers0