Add list view and admin for bookmarks
This commit is contained in:
@@ -1,3 +1,13 @@
|
||||
from django.shortcuts import render
|
||||
from django.utils import timezone
|
||||
from django.views.generic.list import ListView
|
||||
|
||||
# Create your views here.
|
||||
from .models import Bookmark
|
||||
|
||||
class BookmarkListView(ListView):
|
||||
model = Bookmark
|
||||
paginate_by = 20
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['now'] = timezone.now()
|
||||
return context
|
||||
|
||||
Reference in New Issue
Block a user