Rubic schreef:
> Benedict,
> 
> You add a clean_XXX method to your form class,
> where XXX corresponds to the field name you wish
> to validate.
> 
> In your clean_XXX  method, you return
> self.clean_data['XXX'] if your data validates,
> otherwise raise a ValidationError exception.
> 
> I just posted a similar response on this group with
> an example yesterday:  http://tinyurl.com/2w9q2h
> 

Hi,

thanks for the link.

The thing is, i'm trying to do that without defining my
own form class.
Is it possible to add the function after you get the form
from model, something like this?
    IconForm = forms.models.form_for_model(Icon)
    setattr(IconForm,clean_image)
where clean_image is a function.

Or can i define a clean_image function in the class LinksImageField?
I tried that but it doesn't seem to work.

Is there another way (not having to define the whole form) or am i stuck
defining my own form?

Regards,
Benedict


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