diff options
author | luxagraf <sng@luxagraf.net> | 2018-02-05 13:38:59 -0600 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2018-02-05 13:38:59 -0600 |
commit | 3398e7349e2bafddaa491c01f4c16c6dae14cd00 (patch) | |
tree | 0ae25201ce6fc50146dff819b03819ddce148cfe /app/photos/views.py | |
parent | ad112641f01a0fd36d0b738b6903dea3eadbf000 (diff) |
abstracted the next prev links into utils so now they work for every
model that implements a get_%S_admin_link method and loads the JS
Diffstat (limited to 'app/photos/views.py')
-rw-r--r-- | app/photos/views.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/photos/views.py b/app/photos/views.py index fd32828..c0daf4d 100644 --- a/app/photos/views.py +++ b/app/photos/views.py @@ -69,14 +69,16 @@ def photo_json(request, slug): p = PhotoGallery.objects.filter(set_slug=slug) return HttpResponse(serializers.serialize('json', p), mimetype='application/json') +import simplejson def photo_preview_json(request, pk): p = LuxImage.objects.get(pk=pk) - data = () + data = {} data['url'] = p.get_admin_image() - data['prev'] = p.get_previous_admin_url() - data['next'] = p.get_next_admin_url() - return HttpResponse(serializers.serialize('json', data), mimetype='application/json') + data['prev'] = p.get_previous_admin_url + data['next'] = p.get_next_admin_url + data = simplejson.dumps(data) + return HttpResponse(data) def gallery_list_by_area(request, slug, page): |