Flask / Flask SQLAlchemy tipps and tricks

2013-11-15 · 82 words · 1 minute read

I use Flask and Flask-SQLAlchemy for a while now. Doing so i spent a lot of time in searching for the solutions for different problems. See this as my notebook of helpfull snippets. I will update this post from time to time because i don’t want to create a new blog post for each line of helpfull code.

Flask 🔗

Flask SQL-Alchemy 🔗

Querying a certain year by a datetime column:

1
invoices = Invoice.query.filter(extract("year", Invoice.date) == "2012").all()

This return all invoices from 2012.