From f9a2a4163efadfb740fb09867578f66e995803f3 Mon Sep 17 00:00:00 2001 From: Matheus Lins Date: Wed, 26 Oct 2016 18:14:06 -0300 Subject: [PATCH] placing the pagination again in list curses #189 --- courses/templates/course/index.html | 21 +++++++++++++++++++++ courses/views.py | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/courses/templates/course/index.html b/courses/templates/course/index.html index ba689bf..b29f479 100644 --- a/courses/templates/course/index.html +++ b/courses/templates/course/index.html @@ -104,5 +104,26 @@ {% trans 'No courses found' %} {% endif %} +
+ +
{% endblock %} diff --git a/courses/views.py b/courses/views.py index 8474ff4..cd338a4 100644 --- a/courses/views.py +++ b/courses/views.py @@ -30,7 +30,7 @@ class IndexView(LoginRequiredMixin, NotificationMixin, generic.ListView): queryset = Course.objects.all() template_name = 'course/index.html' context_object_name = 'courses' - paginate_by = 2 + paginate_by = 5 def get_context_data(self, **kwargs): context = super(IndexView, self).get_context_data(**kwargs) @@ -197,7 +197,7 @@ class DeleteCourseView(LoginRequiredMixin, HasRoleMixin, generic.DeleteView): return context -class CourseView( NotificationMixin, generic.DetailView): +class CourseView(NotificationMixin, generic.DetailView): login_url = reverse_lazy("core:home") redirect_field_name = 'next' -- libgit2 0.21.2