Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #django #charfield #force #lowercase
ADD COMMENT
Topic
Name
7+9 =