From 289bd78f5a47cbe6b437c17dd5fe955749fefa7b Mon Sep 17 00:00:00 2001 From: Matheus Lins Date: Wed, 5 Oct 2016 01:25:37 -0300 Subject: [PATCH] specific course's filter in view for students and teacher --- courses/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/courses/views.py b/courses/views.py index 85cef22..6b0810e 100644 --- a/courses/views.py +++ b/courses/views.py @@ -24,13 +24,14 @@ class IndexView(LoginRequiredMixin, NotificationMixin, generic.ListView): redirect_field_name = 'next' queryset = Course.objects.all() template_name = 'course/index.html' - context_object_name = 'courses_student' + context_object_name = 'courses' paginate_by = 3 def get_context_data(self, **kwargs): context = super(IndexView, self).get_context_data(**kwargs) context['categories'] = Category.objects.all() context['courses_teacher'] = Course.objects.filter(professors__name = self.request.user.name) + context['courses_student'] = Course.objects.filter(students__name = self.request.user.name) return context -- libgit2 0.21.2