Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Views
  • Loading branch information
kthoden committed Sep 23, 2019
1 parent 0bff264 commit 36fe856
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions opds/views.py
Expand Up @@ -3,16 +3,27 @@
from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.views import generic
from eoapublications.models import *
from eoapublications.models import Publication
from eoaseries.models import Series

from .models import Catalogue

def index(request):
allseries = set(Publication.objects.values_list("Serie", flat=True))
Listofpublications = Publication.objects.filter(Published=True).order_by('-Number').order_by('Serie')
def opds_root(request):
allseries = Series.objects.all().order_by('name')
latestbook = Publication.objects.all().order_by('-Datepublished')[0].Datepublished
Content = {
'Listofpublications' : Listofpublications,
'allseries' : sorted(allseries),
'Series' : Series
'Series' : allseries,
'Lastchange' : latestbook,
}
return render(request, 'eoaseries/index.html', Content)
return render(request, 'opds/root.xml', Content)

def opds_series(request, path):
current_series = path
series_overview = Publication.objects.filter(Published=True, Serie=path)
latestbook = Publication.objects.filter(Published=True, Serie=path).order_by('-Datepublished')[0].Datepublished
Content = {
'Series' : current_series,
'Books' : series_overview,
'Lastchange' : latestbook,
}
return render(request, 'opds/series.xml', Content)

0 comments on commit 36fe856

Please sign in to comment.