'''
Created on 18/mag/2013

@author: Marco Pompili
'''

from django.contrib import admin
from sorl.thumbnail.admin import AdminImageMixin
from .models import Image, Gallery

class ImageInline(AdminImageMixin, admin.StackedInline):
    model = Image
    extra = 3
    fieldsets = (
        (None, {
            'fields' : ('src',)
        }),
        ('Attributes', {
            'classes' : ('collapse',),
            'fields' : ('title', 'alt', 'caption',)
        })
    )

class GalleryAdmin(admin.ModelAdmin):
    list_display = ('codename',)
    inlines = [ImageInline]

admin.site.register(Gallery, GalleryAdmin)
@@ -117,24 +117,30 @@
 mport AdminI
+nlineI
 mageMixin%0Afr
@@ -197,16 +197,22 @@
 e(AdminI
+nlineI
 mageMixi

Fix to the inline image admin class.