Note that you can backslash-escape a format string if you want to use
the “raw” value. In this example, “f” is backslash-escaped, because
otherwise “f” is a format string that displays the time. '''The “o”
doesn’t need to be escaped, because it’s not a format character:'''
{{{
It is the {% now "jS o\f F" %}
}}}
Emphasis mine. This is incorrect. Per the [`date` tag
documentation](https://docs.djangoproject.com/en/dev/ref/templates/builtins/#std
:templatefilter-date), the "o" is a format character. I have verified that
"o" does require a backslash when using `now` template tag in testing.
--
Ticket URL: <https://code.djangoproject.com/ticket/23499>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: nobody => JDougherty
* needs_better_patch: => 0
* status: new => assigned
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/23499#comment:1>
* type: Uncategorized => Bug
* stage: Unreviewed => Accepted
Comment:
Hi,
You're absolutely correct. It seems this was overlooked when the `o`
format was added in a6b6c6e17129379fa1f9ffce1ed7eaaa5d6f1127.
Thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/23499#comment:2>
* has_patch: 0 => 1
Comment:
Fix is available in the `ticket_23499` branch of my repo on github:
https://github.com/JDougherty/django/tree/ticket_23499
However, I feel that since there are now two backslash-escaped characters
in the example, the description is a bit wordy.
I can either leave as is, attempt to rephrase, or try to come up with a
different example where only one backslash would be required.
Should I hold off on the pull request? Please advise, thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/23499#comment:3>
Comment (by bmispelon):
Personally i don't think the modified version is too wordy so you can go
ahead and create the pull request.
--
Ticket URL: <https://code.djangoproject.com/ticket/23499#comment:4>
Comment (by JDougherty):
Pull request created:
https://github.com/django/django/pull/3228
Thank you for the help, bmispelon.
--
Ticket URL: <https://code.djangoproject.com/ticket/23499#comment:5>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"ab8248361e0a7b4fc7684eaaa5891e16b8562683"]:
{{{
#!CommitTicketReference repository=""
revision="ab8248361e0a7b4fc7684eaaa5891e16b8562683"
Fixed #23499 -- Error in built-in template tag "now" documentation
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23499#comment:6>
Comment (by Baptiste Mispelon <bmispelon@…>):
In [changeset:"722516536e0dd99690ab6df4c27bbceb29df4d5b"]:
{{{
#!CommitTicketReference repository=""
revision="722516536e0dd99690ab6df4c27bbceb29df4d5b"
[1.7.x] Fixed #23499 -- Error in built-in template tag "now" documentation
Backport of ab8248361e0a7b4fc7684eaaa5891e16b8562683 from master.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23499#comment:7>
Comment (by Baptiste Mispelon <bmispelon@…>):
In [changeset:"3132edae41dbb13b924e98e8f0254e847155a050"]:
{{{
#!CommitTicketReference repository=""
revision="3132edae41dbb13b924e98e8f0254e847155a050"
[1.4.x] Fixed #23499 -- Error in built-in template tag "now" documentation
Backport of ab8248361e0a7b4fc7684eaaa5891e16b8562683 from master.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23499#comment:8>
Comment (by Baptiste Mispelon <bmispelon@…>):
In [changeset:"9a66244bd8c8b7202ff51f4aa6069f716ab64317"]:
{{{
#!CommitTicketReference repository=""
revision="9a66244bd8c8b7202ff51f4aa6069f716ab64317"
[1.6.x] Fixed #23499 -- Error in built-in template tag "now" documentation
Backport of ab8248361e0a7b4fc7684eaaa5891e16b8562683 from master.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23499#comment:9>