[slightly reordered] On 2015-02-04 18:25, Collin Anderson wrote: > Also, did we decide if the Model-field-layer or Form-field-layer > would be better?
I think the Form-field layer is definitely the place for it. If I do my_model.my_text_field = " leading and trailing " I expect that value to make it in there, spaces and all. But if it comes from a form, the form-field should default to assuming that leading/trailing whitespace is an accident. There have been plenty of times that I've copied/pasted data and missed that leading/trailing whitespace was included. E.g.: copying from Excel is notoriously bad at including trailing newlines. > I can't think of many cases where trailing whitespace has been an > issue for TextFields. Has this been an issue for people? I could > imagine some people would want a trailing newline on TextFields. My password-generator/manager can include spaces in passwords which occasionally come up at the beginning/end of the resulting password. Since it auto-types the value for me, I don't usually give it a thought. But it has stung me once or twice when a site has a password field that eats the whitespace. Thus stung, I tend to no longer include spaces in my generated passwords these days. But again, at the form-level, a TextInput could strip while a PasswordInput could retain, and the underlying models.CharField would preserve whatever the form hands to it. My $0.01 on the matter, -tkc -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/20150204215544.25d97f11%40bigbox.christie.dr. For more options, visit https://groups.google.com/d/optout.
