# HG changeset patch # User Brian Neal # Date 1302044755 0 # Node ID f61db5f8254940653848fdad258cb9a346444211 # Parent a404f93a68d3cb3278b235e71a87a96c86fae5c0 When displaying photos, display by id, ascending. diff -r a404f93a68d3 -r f61db5f82549 mysite/band/views.py --- a/mysite/band/views.py Thu Mar 31 00:14:34 2011 +0000 +++ b/mysite/band/views.py Tue Apr 05 23:05:55 2011 +0000 @@ -182,9 +182,10 @@ def photo_detail(request, id): gallery = get_object_or_404(Gallery, pk = id) + photos = gallery.photos.order_by('id') return render_to_response('band/photo_detail.html', - { 'gallery' : gallery }, - context_instance = RequestContext(request)) + {'gallery' : gallery, 'photos': photos }, + context_instance = RequestContext(request)) ####################################################################### diff -r a404f93a68d3 -r f61db5f82549 mysite/templates/band/photo_detail.html --- a/mysite/templates/band/photo_detail.html Thu Mar 31 00:14:34 2011 +0000 +++ b/mysite/templates/band/photo_detail.html Tue Apr 05 23:05:55 2011 +0000 @@ -19,7 +19,7 @@ {{ gallery.description|textile }}
-{% for photo in gallery.photos.all %} +{% for photo in photos %} {{ photo.caption }} {% endfor %}