I've always struggled to remember between these very similar methods in the SQLALchemy ORM - so I took some time out to research these and write it down.
A few notes on the code review process, and the steps I go through when reviewing.
Building model definitions for many-to-many relationships via a secondary table.
Sick of `alembic merge heads` slowing down your builds? Here's a short bash script I wrote to rename your migration files and update its down revision.
Dive into SQLAlchemy's little known `event.listen` method to automatically generate slugs when saving a model instance.
How to use the `do` Jinja extension to modify an existing dictionary in your view template.
A short snippet for creating a template filter, to present datetime objects in Jinja templates.
Want to store JSON-serialized data in your database? But sick of calling `json.loads()` and `json.dumps()` when dealing with this data in your Flask app? Read on!
How to fix alembic's "Multiple head revisions are present for given argument 'head'" error.
A small Python script to take action whenever a new file is uploaded to a directory or its contents change.