Hi,

I want to do some custom validation in the django admin. I have a
model which looks like:

 class Message(models.Model):
    name = models.CharField(maxlength=30)
    date = models.DateField()
    speaker = models.CharField(maxlength=30)
    path = models.FileField(upload_to='messages/%Y/%m/%d')
    overview = models.TextField()

I want to validate the FileField in particular. The file uploaded
should be a 'music' type file - mp3 or ogg-vorbis. I've figured out
that I'll probably need to override the save() method, but I'm a bit
stuck as to how to continue. I tried using validators_list=[] and
writing a validating method, but it didn't work.

All of the examples I've looked at so far have only dealt with
validating custom forms (not the admin). Maybe this could be included
as an example in the docs...

Anyway, pointers and suggestions would be much appreciated.

Please help, many thanks.

Isaac


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to