summaryrefslogtreecommitdiff
path: root/app/photos/views.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2020-08-06 15:09:05 -0400
committerluxagraf <sng@luxagraf.net>2020-08-06 15:09:05 -0400
commit647176b83d2316a8f68613adac18e579dac6e2b1 (patch)
tree0791939ca747a4ee31f8bd057985a33997591aba /app/photos/views.py
parent5a29df9e2ab7c0d80296907fcb61dccfff1fd008 (diff)
updated to Django 3.1
Diffstat (limited to 'app/photos/views.py')
-rw-r--r--app/photos/views.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/app/photos/views.py b/app/photos/views.py
index 915b022..070b40d 100644
--- a/app/photos/views.py
+++ b/app/photos/views.py
@@ -1,5 +1,5 @@
import json
-from django.shortcuts import render_to_response, render
+from django.shortcuts import render
from django.template import RequestContext
from django.http import Http404, HttpResponse
from django.core import serializers
@@ -64,11 +64,18 @@ class OldGalleryList(PaginatedListView):
class DailyPhotoList(PaginatedListView):
+ model=LuxImage
template_name = 'archives/photo_daily_list.html'
def get_queryset(self):
return LuxImage.objects.filter(is_public=True, title__startswith="daily_")
+ def get_context_data(self, **kwargs):
+ # Call the base implementation first to get a context
+ context = super(DailyPhotoList, self).get_context_data(**kwargs)
+ context['breadcrumbs'] = ['daily',]
+ return context
+
def gallery_list(request, page):
request.page_url = '/photos/%d/'
@@ -84,7 +91,7 @@ def gallery(request, slug):
context = {
'object': PhotoGallery.objects.get(set_slug=slug)
}
- return render_to_response('details/photo_galleries.html', context, context_instance=RequestContext(request))
+ return render(request, 'details/photo_galleries.html', context)
def photo_json(request, slug):
@@ -127,4 +134,4 @@ def gallery_list_by_area(request, slug, page):
'region': region,
'page': page
}
- return render_to_response("archives/photos.html", context, context_instance=RequestContext(request))
+ return render(request, "archives/photos.html", context)