Using database query expressions

Django object-relational mapping (ORM) comes with special abstraction constructs that can be used to build complex database queries. They are called query expressions, and they allow you to filter data, order it, annotate new columns, and aggregate relations. In this recipe, you will see how that can be used in practice. We will create an app that shows viral videos and counts how many times each video has been seen by anonymous (versus logged-in) users.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.4.206