django queryset to form

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