[Django] #16096: Template instances should have an origin attribute.

8 views
Skip to first unread message

Django

unread,
May 25, 2011, 1:22:54 PM5/25/11
to django-...@googlegroups.com
#16096: Template instances should have an origin attribute.
-----------------------------+-------------------------------------------
Reporter: jdunck | Owner: nobody
Type: New feature | Status: new
Milestone: | Component: Template system
Version: 1.3 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 |
-----------------------------+-------------------------------------------
Templates are constructed with an optional origin argument; this is used
for debugging purposes.

But I think it would be useful for the Template instance to have an origin
attribute -- then template origins could be more easily inspected and
logged outside the django.template infrastructure. The specific use case
I have in mind is making it clearer to FE devs which templates/template
dirs are being used for a given request.

Template's constructor receives an origin parameter, so this should be a
simple change.

--
Ticket URL: <https://code.djangoproject.com/ticket/16096>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 26, 2011, 8:57:43 PM5/26/11
to django-...@googlegroups.com
#16096: Template instances should have an origin attribute.
---------------------------------------+---------------------------------
Reporter: jdunck | Owner: nobody
Type: New feature | Status: new
Milestone: | Component: Template system
Version: 1.3 | Severity: Normal
Resolution: | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
---------------------------------------+---------------------------------
Changes (by julien):

* stage: Unreviewed => Accepted


Comment:

This makes sense and it can't hurt. Are you thinking of any particular API
other than just setting the `origin` attribute to the `Template` instance?

--
Ticket URL: <https://code.djangoproject.com/ticket/16096#comment:1>

Django

unread,
Aug 30, 2013, 4:00:00 PM8/30/13
to django-...@googlegroups.com
#16096: Template instances should have an origin attribute.
---------------------------------+------------------------------------

Reporter: jdunck | Owner: nobody
Type: New feature | Status: new
Component: Template system | Version: 1.3
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------

Comment (by prestontimmons):

I added a pull request for this here.

https://github.com/django/django/pull/1534

--
Ticket URL: <https://code.djangoproject.com/ticket/16096#comment:3>

Django

unread,
Sep 5, 2013, 12:22:42 PM9/5/13
to django-...@googlegroups.com
#16096: Template instances should have an origin attribute.
---------------------------------+------------------------------------

Reporter: jdunck | Owner: nobody
Type: New feature | Status: new
Component: Template system | Version: 1.3
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by timo):

* needs_better_patch: 0 => 1
* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/16096#comment:4>

Django

unread,
Sep 6, 2013, 9:16:05 AM9/6/13
to django-...@googlegroups.com
#16096: Template instances should have an origin attribute.
---------------------------------+------------------------------------
Reporter: jdunck | Owner: nobody
Type: New feature | Status: closed

Component: Template system | Version: 1.3
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"8625c7aab3760d16572792fea23a95e572e28ead"]:
{{{
#!CommitTicketReference repository=""
revision="8625c7aab3760d16572792fea23a95e572e28ead"
Fixed #16096 -- Added origin attribute to template instances.

Thanks jdunck for the suggestion.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/16096#comment:5>

Reply all
Reply to author
Forward
0 new messages