Making QuerySet & Query Expressions with Django ORM like SQL, or Django ORM == SQL.
If you are migrating to Django from another MVC framework, chances are you already know SQL.
In this post, we will be illustrating how to use Django ORM by drawing analogies to equivalent SQL statements. Connecting a new topic to your existing knowledge will help you learn to use the ORM faster.
Let us consider a simple base model for a person with attributes name, age, and gender.
(більше…)