logo       

clean_<fieldname>() doesn't handle images?: msg#02216

DjangoUsers

Subject: clean_<fieldname>() doesn't handle images?


Hey,

I've got the following code in my models.py:

from django import forms
class Foto(models.Model):
omschrijving = models.CharField(max_length=100)
afbeelding = models.ImageField(upload_to='media/afbeeldingen/
header/fotos')

def clean_afbeelding(self):
raise forms.ValidationError("Never good! :-)")

Still, if I upload an image it validates, where it shouldn't, right?

--~--~---------~--~----~------------~-------~--~----~
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@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
django-users+unsubscribe@xxxxxxxxxxxxxxxx
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise