Whilst I disagree with the proposed implementation of the ticket, the fact that `DATE_FORMAT` uses a version of formatting (like the date filter[1]) which are actually impossible to duplicate precisely using strftime, it is an irritation when in some cases user facing strings are built in python rather than in the template language.
So I'm against the proposed solution, but I'd like to see some way to more easily format a date to a string in the same way it would be by just writing {{ date }} in a template. If such a utility function exists, it should be better documented. M On 9 March 2014 18:52, Aymeric Augustin <aymeric.augus...@polytechnique.org>wrote: > On 9 mars 2014, at 18:36, Jon Dufresne <jon.dufre...@gmail.com> wrote: > > > I understand what you're saying, but how is this any different than > > rendering a date as a string at template time? The Locale needs to be > > considered in both cases. > > unicode(...) may end up stored in various places such as logs, where the > locale of the original request may not be known. On the contrary, templates > are immediately displayed to an end user. > > > Both these concerns could be solved with a setting to turn this > > feature on and be off by default. > > If you've spent some time on this mailing list, you know that "just > add a setting" isn't a compelling argument, to say the least... > > On 9 mars 2014, at 19:01, Jon Dufresne <jon.dufre...@gmail.com> wrote: > > > As best I can tell, [DATE_FORMAT] is only the default > > formatting to use for displaying dates in > > templates. When dates are displayed through other means (such as > > string formatting), this format sepcification is ignored. This is what > > I find confusing and what I hope I could fix. > > I agree, the documentation should clarify that DATE_FORMAT mostly > applies to templates and forms. > > -- > Aymeric. > > -- > You received this message because you are subscribed to the Google Groups > "Django developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-developers+unsubscr...@googlegroups.com. > To post to this group, send email to django-developers@googlegroups.com. > 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/CF3A11BD-EF70-49C8-AA57-90F54C02C796%40polytechnique.org > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. 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/CAMwjO1FeypurBk%2BD8rDJQQP710pDM_mpV-37x780r1fjgQVfUQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.