Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CourseListView(ListView):
- model = Course
- class CourseDetailView(DetailView):
- model = Course
- def get(self, request, *args, **kwargs) :
- response = super().get(request, *args, **kwargs)
- Course.objects.filter(pk=self.object.pk).update(visited_times=F('visited_times') + 1)
- return response
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement