I have a ModelForm like this:

<code>
class PlanForm(forms.ModelForm):
    funds  = forms.ChoiceField(widget=forms.Select)

    # This does get called but does not see 'funds' field!
    def clean(self):
        logging.debug("clean: cleaning data: %s" % self.cleaned_data)
        return self.cleaned_data

    # Does not get called!! Why?
    def clean_funds(self):
        data = self.cleaned_data['funds']
        logging.debug("clean_funds: cleaning data: %s" % data)
        return data
</code>

I actually started the debugger and in there I can see that the django
\forms\forms.py(221)full_clean() method does call the ChoiceFields
clean method first, which throws a ValidationError, and the clean_funds
() method never gets called.

Is there a way I can specify that I want to do my own cleaning? Or
somehow point the ChoiceField to the right cleaning routine?

Thanks!

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to