Django Advanced Queries
This post will show some more advanced parts of the Django ORM and the queries you can do with it. There are multiple ways to achieve the same query result in Django, but this post will focus on the ways done through the ORM and the python functions. Raw SQL For completeness, I quickly mention the way to execute raw SQL statements. In my opinion, this way should be used as a last resort, if no other way works because you loose a lot of benefits like type conversion and bound checks if you completly skip the ORM and access the database directly....