Oh true,
didnt get the 500 error howerver no way to raise the error
isValideImageWeight.
all the test get added, when i check in the admin view the field
"image" is empty.
Is there a way to see what value does all fields have before being
inserted to the db, looks like image is empty...
my model :
[...]
image = meta.ImageField(upload_to='img', help_text=_('Photot du plat
fini') , blank=True, null = True)
[...]
the template :
[...]
<p><label for="id_image">Photo du plat fini:
</label>{{form.image_file}}{{ form.image }} <i>(100*100
pixels)</i></p>
[...]
the view.py
[...]
#Validator
def isValideImageWeight(self, field_data, all_data):
print field_data
if len(field_data["content"]) > 100:
raise validators.ValidationError, "file too big !"
#Ajouter
def create_recette(request):
manipulator = recettes.AddManipulator()
#12 being image_fil , recettes.AddManipulator().fields
manipulator.fields[12].validator_list.append(isValideImageWeight)
manipulator.fields[11].validator_list.append(isValideImageWeight)
[...]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---