Reason: Having consistent data representation in the database is nice, and 
maybe also useful in some use-cases, e.g. using the data to train a deep 
learning model. This tweak seems it could only help, and shouldn't break 
anything. If, for some reason a developer needs to use \r\n for display, he 
cannot rely on the client to always send \r\n in the form data, because OSX 
or unix sends just \n, so it seems to me that if I would need \r\n for 
display, It would also be nice to have just \n in the database, and replace 
it using a template filter during html construction.

On Monday, November 12, 2018 at 3:58:39 PM UTC+1, Jakub Kleň wrote:
> I'm thinking if it wouldn't be nice if django automatically normalized 
> newlines of data entered by the user. The implementation would be really 
> simple, there's already a function for it in 
> django.utils.text.normalize_newlines, and it would go into 
> django.forms.fields.CharField.to_python the same as split() (maybe also 
> with an ivar for controlling the behavior, although I'm not sure if it's 
> needed). What do you think?

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 post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

Reply via email to