However, I can't get this to work. I have created a custom validator,
which checks whether the filetype is of mp3 or ogg, and that the
extension is 'mp3' or 'ogg'. This works fine for the initial upload
(and indeed I can upload files!), but when I go to the 'edit' part of
the admin and upload a new file, I get a TypeError. This is because in
my validator, I check the field_data the first time for 'filename' and
'content-type', because field_type is a dictionary, but it seems that
on an edit, field_type is a string with the filename of the _previous_
file which was uploaded. Why?!
Anyway, my question is: how can I complete this (seemingly) relatively
simple task of validation?
Here's my code so far: http://dpaste.com/5068/
Any help would be much appreciated.
--
Isaac