May 15, 2025
values(): Returns dictionaries, allowing selection of specific columns.values_list(): Returns tuples, often more performant.values()
values_list()
flat=True: Flattens the output to a list without tuples.count(), avg(), min(), max(), sum().aggregate(): Allows multiple aggregations, returns a dictionary.annotate(): Adds computed fields to each model in a queryset.Upper and Concat are used for transformations.values() before annotate():
filter() and order_by() on annotated fields.