Skip to content
Permalink
36fe856ab4
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
29 lines (26 sloc) 1.04 KB
#-*- coding: utf-8 -*-
from django.urls import reverse
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 Publication
from eoaseries.models import Series
from .models import Catalogue
def opds_root(request):
allseries = Series.objects.all().order_by('name')
latestbook = Publication.objects.all().order_by('-Datepublished')[0].Datepublished
Content = {
'Series' : allseries,
'Lastchange' : latestbook,
}
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)