Hi, This is my code:
class LogoAdminForm(forms.ModelForm): class Meta: model = Logo def clean(self): from django.core.files.images import get_image_dimensions logo = self.cleaned_data['logo'] w, h = get_image_dimensions(logo) if w > 150 or h > 150: raise forms.ValidationError(u'That logo is too big. Please resize it so that it is 32x32 pixels or less, although 150x150 pixels is optimal for display purposes.') return logo class LogoAdmin(admin.ModelAdmin): exclude = ['height','width',] form = LogoAdminForm search_fields = ('name','logo','altText',) list_display = ('name','logo',) admin.site.register(Logo,LogoAdmin) This works when editting a logo, but when I try to add a logo it enters a fully blank row into the database. Can anyone give me a hint as to why this is the case please ? Thank you --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---