November 2015
Beginner to intermediate
840 pages
26h 30m
English
To begin, we can change the inheritance in PostCreate and PostList to use CreateView and ListView, removing all of the methods from those classes, and leaving the attributes as is, as shown in Example 17.30.
Example 17.30: Project Code
5 from django.views.generic import ( 6 CreateView, ListView, View) . ... 12 class PostCreate(CreateView): 13 form_class = PostForm 14 model = Post . ... 53 class PostList(ListView): 54 model = Post
Read now
Unlock full access