i have written validaiton function for an attribute is it correct and how should i write for same attribute with blank = True and add_1 is required field any conditions to add
add_1 = models.CharField(max_length=255)
add_2 = models.CharField(max_length=255, blank=True)
Note: All validators must return True or False
validators.py
def validate_add_1(value):
if value is not None:
try:
if len(value) <= 255:
return True
except ValidationError:
return False