Is there any options for form field so that any input shall be automatically converted to capital letter and trim from white spaces at the beginning and the end?
If there is not, what is the best practice in enforcing the options above?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could just override the
cleanmethod.Note that this will run /after/ individual field validation.
To prevent errors with dates
You could also check if the value is
isinstance(value, basestring)and only operate on those.