Skip to main content
Django Code Reorder Hard +35 XP

Class-Based View

Arrange the Django class-based view.

Click lines in the correct order

Available lines4 left

Your order

Click lines above to build your solution.

Show answer and explanation

Answer: class PostListView(ListView): model = Post queryset = Post.objects.filter(published=True) template_name = "posts/list.html"

Class declaration first, then model, then queryset override, then template name.

Hint: Class comes first, attributes inside.

What this challenge tests

Code Reorder in Django: class-based-views, ListView.

Related challenges