Pushing the ORM to its limits
It is also easy to drop down to writing raw SQL if you need to. It is probably not something you need to do every day, but it’s good to know that the option is there, and know how and when to do it.
Starting with Django 1.11, you can easily make subqueries using the Django ORM. In Django 2.0 we got support for window functions. Django 2.1 exposes additional functions that are available in many databases, and version 2.2 will introduce support for custom constraints and extends the primitives for …