django queryset to form
- Use the Django ORM to create a queryset.
- Apply filters or conditions to the queryset using methods like filter(), exclude(), get(), etc.
- Chain multiple filter conditions using the "&" and "|" operators for "and" and "or" logic.
- Use the values() method to specify the fields to include in the result set.
- Use the annotate() method to perform aggregation and annotation on the queryset.
- Apply ordering to the queryset using order_by() method.
- Use the distinct() method to eliminate duplicate rows from the result set.