diff options
Diffstat (limited to 'app/photos')
-rw-r--r-- | app/photos/admin.py | 6 | ||||
-rw-r--r-- | app/photos/forms.py | 5 | ||||
-rw-r--r-- | app/photos/models.py | 1 |
3 files changed, 5 insertions, 7 deletions
diff --git a/app/photos/admin.py b/app/photos/admin.py index 9453734..83fbae8 100644 --- a/app/photos/admin.py +++ b/app/photos/admin.py @@ -38,7 +38,7 @@ class LuxImageAdmin(OSMGeoAdmin): fieldsets = ( (None, { - 'fields': (('image', 'pub_date'), 'sizes', ('title', 'alt'), 'caption', 'point', ('is_public', 'is_video'), ('photo_credit_source','photo_credit_url')) + 'fields': (('image', 'pub_date'), 'sizes', ('title', 'alt'), 'caption', 'point', ('is_public', 'is_video'), ('photo_credit_source', 'photo_credit_url')) }), ('Exif Data', { 'classes': ('collapse',), @@ -47,10 +47,6 @@ class LuxImageAdmin(OSMGeoAdmin): ) - - - - admin.site.register(LuxImage, LuxImageAdmin) diff --git a/app/photos/forms.py b/app/photos/forms.py index 8ad89f2..03c6f09 100644 --- a/app/photos/forms.py +++ b/app/photos/forms.py @@ -39,8 +39,11 @@ class GalleryForm(forms.ModelForm): items = [] for image in images: items.append( - (image.pk, mark_safe('%sqq%s' % (image.title, image.get_image_name()))) + (image.pk, mark_safe('%sqq%sqq%s' % (image.title, image.get_image_by_size('tn'), image.pk))) ) + + + self.fields['images'].choices = items self.fields['images'].allow_tags = True diff --git a/app/photos/models.py b/app/photos/models.py index 048dd65..6907a25 100644 --- a/app/photos/models.py +++ b/app/photos/models.py @@ -74,7 +74,6 @@ class LuxImage(models.Model): if size.width <= 800: return self.get_image_by_size(size) - def get_image_name(self): return self.image.url.split("original/")[1][5:-4] |