2020-04-25 15:35:02 +00:00
|
|
|
from django.views.generic.list import ListView
|
2020-04-25 16:37:48 +00:00
|
|
|
from django.conf import settings
|
2020-04-25 15:35:02 +00:00
|
|
|
|
|
|
|
from ubookmark.models import *
|
|
|
|
|
|
|
|
class IndexView(ListView):
|
|
|
|
|
|
|
|
model = BookmarkModel
|
2020-04-25 16:37:48 +00:00
|
|
|
paginate_by = 3
|
|
|
|
queryset = BookmarkModel.objects.order_by('-posted_at')
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs):
|
|
|
|
context = super(IndexView, self).get_context_data(**kwargs)
|
|
|
|
context['site_name'] = settings.SITE_NAME
|
|
|
|
context['site_description'] = settings.SITE_DESCRIPTION
|
|
|
|
|
|
|
|
return context
|