From 79b3268e10706e1ea14d7ba1275a9744ce51cd3a Mon Sep 17 00:00:00 2001 From: luxagraf Date: Fri, 13 Sep 2013 00:52:33 +0000 Subject: fixed some bugs related to larger images and new flickr scripts --- app/photos/models.py | 6 ++++-- app/photos/retriever.py | 6 +++--- design/templates/details/photo_galleries.html | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/photos/models.py b/app/photos/models.py index a87b60d..e64e186 100644 --- a/app/photos/models.py +++ b/app/photos/models.py @@ -85,6 +85,8 @@ class Photo(models.Model): def get_original_url(self): #return self.get_pic_url(size="original") return "http://farm%s.static.flickr.com/%s/%s_%s_o.jpg" % (self.flickr_farm, self.flickr_server, self.flickr_id, self.flickr_originalsecret) + def get_retina_slideshow_url(self): + return '%sslideshow/%s/%sx2.jpg' %(settings.IMAGES_URL,self.pub_date.strftime("%Y"),self.flickr_id) def has_retina(self): return os.path.isfile('%s/slideshow/%s/%sx2.jpg' %(settings.IMAGES_ROOT,self.pub_date.strftime("%Y"),self.flickr_id)) @@ -151,8 +153,8 @@ class Photo(models.Model): def get_tumble_image(self): return "%s/crops/%s/%s.jpg" %(settings.IMAGES_URL, self.pub_date.strftime("%Y/%b").lower(), self.id) - - + + def get_previous_published(self): return self.get_previous_by_pub_date() diff --git a/app/photos/retriever.py b/app/photos/retriever.py index 959b908..4dfbc49 100644 --- a/app/photos/retriever.py +++ b/app/photos/retriever.py @@ -134,9 +134,9 @@ def get_photos_in_set(flickr_photoset, photoset): p = Photo.objects.get(flickr_id__exact=str(photo['id'])) except ObjectDoesNotExist: p = get_photo(photo) - print p.title - photoset.photos.add(p) - slideshow_image(p, 1000, 800, 95) + if p.is_public == True: + photoset.photos.add(p) + slideshow_image(p, 1000, 800, 95) ################################################ diff --git a/design/templates/details/photo_galleries.html b/design/templates/details/photo_galleries.html index 33550f7..a7eed95 100644 --- a/design/templates/details/photo_galleries.html +++ b/design/templates/details/photo_galleries.html @@ -20,7 +20,7 @@

Photos from {{object.set_title}}

{%for photo in object.photos.all reversed %}
-
{{photo.title}}
+
{{photo.title}}

{{photo.title}}   

-- cgit v1.2.3-70-g09d2