Crap, hit the send key, there it goes. Sorry.

Hi!
>
> I'm trying to override the AdminFileWidget with no success. The idea is to
> get a thumbnail
> next to the uploaded files in a tabular view of the admin site. I did the
> following :
>
> class AdminImageWidget(AdminFileWidget):
>     def render(self, name, value, attrs=None):
>
>
Override the widget class for the image field

class ImageGalleryForm(forms.ModelForm):
    '''
        Image Admin form
    '''
    class Meta:
        model = HomeImage
        fields =('image','description','name','height','width',)
        widgets = {
            'image' : AdminImageWidget,
        }


Here I set the Form

class ImageGaleryInline(admin.TabularInline):
    form = ImageGalleryForm
    model = HomeImage
    extra = 3

    fieldsets = [
        (None, {
            'fields' : [
                ('image','description','name','height','width'),
                ]
            }
        ),
    ]


But the widget still shows itself as the AdminFileWidget, Am I missing
something ?

Thanks



>
> --
> Nicolas Emiliani
>
> Lo unico instantaneo en la vida es el cafe, y es bien feo.
>



-- 
Nicolas Emiliani

Lo unico instantaneo en la vida es el cafe, y es bien feo.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to