diff options
Diffstat (limited to 'apps/photos')
-rw-r--r-- | apps/photos/models.py | 6 | ||||
-rw-r--r-- | apps/photos/views.py | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/apps/photos/models.py b/apps/photos/models.py index f13b17a..d5f4d51 100644 --- a/apps/photos/models.py +++ b/apps/photos/models.py @@ -114,6 +114,12 @@ class Photo(models.Model): def flickr_link(self): return '%s%s/' %('http://www.flickr.com/photos/luxagraf/', self.flickr_id) + @property + def is_portait(self): + if int(self.slideshowimage_height) > int(self.slideshowimage_width): + return True + else: + return False def get_pic_url(self, size='small'): # small_square=75x75 # thumb=100 on longest side diff --git a/apps/photos/views.py b/apps/photos/views.py index 5b993b4..3edfccb 100644 --- a/apps/photos/views.py +++ b/apps/photos/views.py @@ -14,7 +14,7 @@ def gallery_list(request,page): request.page_url = '/photos/%d/' request.page = int(page) qs = PhotoGallery.objects.all() - return object_list(request, queryset=qs, template_name='archives/photos.html') + return object_list(request, queryset=qs, template_name='archives/photos.html',extra_context={'page':page,}) def gallery(request,slug): context = { @@ -43,7 +43,8 @@ def gallery_list_by_area(request,slug,page): context = { 'region': region, 'country_list': Country.objects.filter(visited=True), - 'region_list': Region.objects.all() + 'region_list': Region.objects.all(), + 'page': page } return object_list(request, queryset=qs, template_name='archives/photos.html', extra_context=context) |