On Nov 9, 9:11 am, Ralf Peschke <rpesc...@peschke-it.de> wrote: > Thank you for your response, Cliff. > But the strip-command wasn't my problem. I wondered why Django let pass > these kind of invalid input and if there is an easy way to toggle this > behavior for the whole project. I could not find anything in the Django > docs. > Now I'm thinking of overwriting the to_python-Method of the models > charField-class. > Or are there better solutions?
Why should Django think that input is invalid? It's perfectly valid content for a textbox - it's just your business rules that say otherwise. So you need to tell Django about your business rules, which you do via validation: http://docs.djangoproject.com/en/1.2/ref/validators/ -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.