Answers for "django charfield force lowercase"

0

django charfield force lowercase

# Just do it in the save method. ie, override the save method of Model class.

def save(self, *args, **kwargs):
    self.username = self.username.lower()
    return super(User, self).save(*args, **kwargs)
Posted by: Guest on May-26-2020

Code answers related to "django charfield force lowercase"

Python Answers by Framework

Browse Popular Code Answers by Language