Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Aggregate and Annotate6:32 with Kenneth Love
Sometimes we need to get more information on the QuerySet or on each item in the QuerySet. And if the database can do the work for us, why not let it?
Here are the Django docs for aggregations and annotation.
You can use
F() objects in your aggregations and annotations if you need things to be more up-to-date or directly from the database. There are several aggregates available so be sure to look through the documentation to find the ones you need or want to use.
You need to sign up for Treehouse in order to download course files.Sign up