I'm not an expert, actually I've just started looking into the django source recently. My first idea would be to inherit from the ImageField Field, call it MyImageField. In MyImageField override the validate method and if the width isn't what you want, raise a django.core.validators.ValidationErrorexception. Surely this will cause Model.save() to fail. After that you might want to delete the image from disk as well, or just run a script every night to delete all images on disk that aren't references in the db.
Dave On Jan 8, 2008 5:18 PM, Rodrigo Culagovski <[EMAIL PROTECTED]> wrote: > > How can you validate that an ImageField's width is <= a maximum in > pixels? > > > -- David Grant http://www.davidgrant.ca --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---