Django Aggregation & Annotation / values() and values_list() functions

Django Aggregation & Annotation / values() and values_list() functions

13.718 Lượt nghe
Django Aggregation & Annotation / values() and values_list() functions
In this video, we look at aggregation and annotation in Django - how to summarize and aggregate data to get summary statistics and insights into your application data. We look at how to annotate models with additional data, using the annotate() function, and how to pair this with the values() function to create specific groupings of data that can then be analysed and aggregated. We also look at the values() and values_list() functions in general in this video. 📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀: 00:00 Intro 01:37 values function on Django QuerySets 06:41 Transforming values with database functions 08:25 Getting Foreign Key data with values() function 10:47 values_list() function on Django QuerySets 13:48 Aggregating values in Django with aggregate() method 24:18 Annotating models in Django with annotate() method ☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲: To support the channel and encourage new videos, please consider buying me a coffee here: https://ko-fi.com/bugbytes ▶️ Full Playlist: https://www.youtube.com/playlist?list=PL-2EBeDYMIbTT7ri4pNEBu9VoVSAkOvd2 𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮: 📖 Blog: https://bugbytes.io/posts/ 👾 Github: https://github.com/bugbytes-io/django-orm-series 📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻: Django Aggregation: https://docs.djangoproject.com/en/4.2/topics/db/aggregation/ Aggregate with values(): https://docs.djangoproject.com/en/4.2/topics/db/aggregation/#values Annotate function: https://docs.djangoproject.com/en/4.2/ref/models/querysets/#annotate Aggregate function: https://docs.djangoproject.com/en/4.2/ref/models/querysets/#aggregate values() function: https://docs.djangoproject.com/en/4.2/ref/models/querysets/#values values_list() function: https://docs.djangoproject.com/en/4.2/ref/models/querysets/#values-list #python #django #webdevelopment #database #sql