Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 835 Bytes

checklist.md

File metadata and controls

38 lines (25 loc) · 835 Bytes

Check Your Code Against the Following Points

Code Style

  1. Do not forget about type annotation in class methods.

  2. You do not need .all() method before .prefetch_related() and .select_related() methods:

Good example:

queryset = Movie.objects.prefetch_related("actors")

Bad example:

queryset = Movie.objects.all().prefetch_related("actors")
  1. You can provide multiple arguments into prefetch_related method:

Good example:

queryset = Movie.objects.prefetch_related("actors", "genres")

Bad example:

queryset = Movie.objects.prefetch_related("actors").prefetch_related("genres")

Clean Code

Add comments, prints, and functions to check your solution when you write your code. Don't forget to delete them when you are ready to commit and push your code.