Hi Abraham,
This is beautiful & is of huge help! thank you. :)
I created a new file named /validators.py and add the below
code.
from django.core.validators import EmailValidator
from django.core.exceptions import ValidationError
def multi_email_validator(value):
if value and "," in value:
Hi,
If all u nid is a field whose value is a comma separated list of emails den u
dont nid a custom field at all. All u nid is a gud ol CharField. Just set it
like so:
emails=models.CharField(max_length=500, validators=[multi_email_validator,]).
here is what multi_email_validator looks like:
from
I've never done it myself, but I think you'd just define the clean method
in your Form's class (i.e. in forms.py), and the first line in your clean()
method should call the parent classes, clean() method - to do this you need
to call the super() method, which is just regular python. It think the
c
Hi Chris,
Thank you very much for your time on this. I am not able to make out on how
could I put this under clean() method. Ex: What does "you must call
the*parent class's clean()
"* mean in "if you would like to override the clean() method and maintain
the _default validation_, you must call the
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 li
Again, I'm not sure, but I think to do it at Model validation level you'd
have to modify some of the django core files themselve. I think what
you're looking for is in django.core.validators (in my install this file is
at /lib/python2.7/site-packages/django/core/validators.py, or you can just
On Fri, Nov 2, 2012 at 5:52 PM, Chris Pagnutti wrote:
> Hi. I'm pretty new to Django too, so someone else probably has a better
> idea. But I think that on the server side, you can handle additional
> validation in the view that handles the form submission (i.e. the view that
> the "action" attr
Hi. I'm pretty new to Django too, so someone else probably has a better
idea. But I think that on the server side, you can handle additional
validation in the view that handles the form submission (i.e. the view that
the "action" attribute in your form points to). You can probably attach
err
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):
9 matches
Mail list logo