fmartingr
/
shelfzilla
Archived
1
0
Fork 0
This repository has been archived on 2021-06-29. You can view files and clone it, but cannot push or open issues or pull requests.
shelfzilla/shelfzilla/apps/manga/views/series.py

36 lines
913 B
Python

from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404
from shelfzilla.views import View
from ..models import Series
class SeriesView(View):
section = 'series'
class SeriesListView(SeriesView):
template = 'manga/series/list.html'
def get(self, request):
items = Series.objects.all()
context = {
'items': items
}
ctx = RequestContext(request, self.get_context(context))
return render_to_response(self.template, context_instance=ctx)
class SeriesDetailView(SeriesView):
template = 'manga/series/detail.html'
def get(self, request, sid):
item = get_object_or_404(Series, pk=sid)
context = {
'item': item
}
ctx = RequestContext(request, self.get_context(context))
return render_to_response(self.template, context_instance=ctx)