In a field of my Django model I want the user to type a dot ('.') at the end of a Textfield. Otherwise I want to add it.
I've thought about using a validator but it seems it's not the proper way to do it:
name = models.TextField(validators=[validate_dot])
def validate_dot(value):
if value:
if value[-1] != '.':
return value + '.'
Whay I need is to change the value of the TextField (if required) not to raise an error.
What is the best approach to achieve it?