1 2 3 4 5 6 | # better solution proposed by KpoH:
from django.forms.fields import email_re
def is_valid_email(email):
return True if email_re.match(email) else False
|
More like this
- models.MultipleEmailField by fero 4 months, 1 week ago
- Multiple emails form field by virhilo 2 years, 2 months ago
- ajax_validator generic view by amitu 3 years, 7 months ago
- New forms signup validation by Batiste 5 years, 1 month ago
- EmailListField for Django by sciyoshi 2 years, 9 months ago
Comments
better solution
#
even better :)
or
#
hey there thanks.
can you please repost that in a new snippet?
just realized my code is not even working properly.
sorry about that
#
nevermind about reposting, i just put in your code
#
This is cleaner:
but a function is redundant, instead of calling it each time, one can simply do:
#
Just a note for those on Django 1.1.1 or higher having trouble getting this to work...
The location of the regular expression has moved to:
#