--
Ticket URL: <https://code.djangoproject.com/ticket/20457>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_docs: => 0
* needs_better_patch: => 0
* version: => master
* needs_tests: => 0
* stage: Unreviewed => Accepted
Comment:
It's defined here:
https://github.com/django/code.djangoproject.com/blob/master/trac-
env/templates/site.html#L37
If somone knows the equivalent of `{% now 'Y' %}` in Genshi, that'd help
:)
--
Ticket URL: <https://code.djangoproject.com/ticket/20457#comment:1>
* owner: nobody => giuliettamasina
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/20457#comment:2>
Comment (by svisser):
It seems one can define it using Python's `datetime`:
http://genshi.edgewall.org/wiki/Documentation/templates.html#id1 .
--
Ticket URL: <https://code.djangoproject.com/ticket/20457#comment:3>
Comment (by giuliettamasina):
Hmm, maybe a bit heavy to import a whole module just to print a simple
year string? Or maybe not; I'm wondering if it could be performance
measured somehow.
I will look into it and propose some sort of change, thanks for the info
svisser :)
--
Ticket URL: <https://code.djangoproject.com/ticket/20457#comment:4>
Comment (by aaugustin):
I don't expect performance to be an issue. Importing a module is very fast
once it's in `sys.modules`.
--
Ticket URL: <https://code.djangoproject.com/ticket/20457#comment:5>
Comment (by giuliettamasina):
Cool, I'll send in a pull request for this soonish.
--
Ticket URL: <https://code.djangoproject.com/ticket/20457#comment:6>
* cc: bmispelon@… (added)
* has_patch: 0 => 1
Comment:
I was playing around a bit and I found that you have access to
`datetime.date` in the `site.html` context.
I couldn't find this documented anywhere so I'm not sure how reliable it
is, but it worked on my local trac instance.
This makes the change rather trivial:
https://github.com/django/code.djangoproject.com/pull/6/files.
--
Ticket URL: <https://code.djangoproject.com/ticket/20457#comment:7>
* stage: Accepted => Ready for checkin
Comment:
As long as it works...
--
Ticket URL: <https://code.djangoproject.com/ticket/20457#comment:8>
* status: assigned => closed
* resolution: => fixed
Comment:
Fixed in a84118fd335736b358acf4673bccd38d52e00a5e.
--
Ticket URL: <https://code.djangoproject.com/ticket/20457#comment:9>