summaryrefslogtreecommitdiff
path: root/sublab_project/news/views.py
blob: ff62be52a86575da96e9f541d2e3481d9fdea496 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# Create your views here.
from django.views.generic import ListView
from django.core.paginator import Paginator

from news.models import News

class NewsListView(ListView):
    model = News
    paginate_by = 8

    def get_paginator(self, queryset, per_page, **kwargs):
        kwargs['orphans'] = 3
        return Paginator(queryset, per_page, **kwargs)