i try to force the user to use only alphanumeric characters in a certain
field so i wrote the following code in the User model:
alphanumeric = RegexValidator(r'^[0-9a-zA-Z]*$', message='Only alphanumeric characters are allowed.')
username = models.CharField(unique=True, max_length=20, validators=[alphanumeric])
but i still can create:
User.objects.create(username="@@")
i don't want it to create something like it...
am i doing something wrong? did i wrote a wrong regex validator?