email validation using django
from django import forms
class MyForm(forms.Form):
even_field = forms.IntegerField(validators=[validate_even])
email validation using django
from django import forms
class MyForm(forms.Form):
even_field = forms.IntegerField(validators=[validate_even])
email validation using django
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
def validate_even(value):
if value % 2 != 0:
raise ValidationError(
_('%(value)s is not an even number'),
params={'value': value},
)
email validation using django
from django.db import models
class MyModel(models.Model):
even_field = models.IntegerField(validators=[validate_even])
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us