importing cs50 sql to sqlalchemy
importing cs50 sql to sqlalchemy
I am trying to migrate my cs50 projects from the cs50 ide to my desktop.
To get flask and sql to work, i have had to replace mysql database with FlaskSQLAlchemy.
One of the queries i had in application.py previously was:
place = db.execute("SELECT * FROM places WHERE postal_code LIKE :q OR place_name LIKE :q OR admin_name1 LIKE :q", q=q)
which would fill place with all queries that match postal_code || place_name || admin_name1
How would i do this with sqlalchemy?
How do boolean operations work?
i have seen syntax such as places.query.filter_by() and also places.query.filter(). I didn't quite understand the difference in the 2 from the documentation.
Sorry if this is a repeat question. Alittle overwhelmed and could use a starting push.
Thanks in advance!
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.