Ahh. Just saw your link to overriding the clean() method. So you could put all the same logic above into the clean() method instead.
On Friday, November 2, 2012 4:36:20 AM UTC-4, Dilip M wrote: > > Hi, > > I am new to Django. Went through docs before posting this.. I have a model > and form like this. > > models.py: > > class Recipients(models.Model): > dev = models.EmailField() > qa = models.EmailField() > cc = models.MultipleEmailField() > > forms.py: > > class RecipientsForm(forms.ModelForm): > > class Meta: > model = Recipients > > > Now I want to, > > 1. Add *additional* validation for models.EmailField(). Something like > check if email id entered exists in LDAP db. > 2. Create new model custom field MultipleEmailField(), which would split > emails separated by comma and uses modified validation of > models.EmailField() done in step 1. > > I am going through docs, but not able to figure out how to put things > together! Here is what I understood. > > MultipleEmailField() should go in <project-name>/fields.py. But how to > make it to run default validation of models.EmailField() and than do custom > validation? > > > Any help appreciated.. > > > Thanks. Dilip > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/h1CS3km1y2wJ. 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.