Opened 13 years ago

Closed 13 years ago

#16787 closed Bug (fixed)

{% load %} doesn't work with libraries in package heierarcy

Reported by: Ivan Sagalaev Owned by: Ivan Sagalaev
Component: Template system Version: 1.3
Severity: Release blocker Keywords:
Cc: chris@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Jannis Leidel)

In other words {% load package.lib %} doesn't work.

The docstring of load tag suggests it should work and it used to work before changeset r12944. We should allow this behavior again and document it properly in docs.

Attachments (5)

16787.diff (3.1 KB ) - added by Ivan Sagalaev 13 years ago.
Patch with tests and docs
16787.2.diff (4.0 KB ) - added by Ivan Sagalaev 13 years ago.
Patch with all new included.
16787.3.diff (5.9 KB ) - added by Ivan Sagalaev 13 years ago.
More specific tests
16787.4.diff (6.0 KB ) - added by Ivan Sagalaev 13 years ago.
Fixed some typos, reformulated docstring.
16787.5.diff (5.9 KB ) - added by Ivan Sagalaev 13 years ago.
Patch updated to current trunk

Download all attachments as: .zip

Change History (12)

comment:1 by Jannis Leidel, 13 years ago

Description: modified (diff)
Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

This is a regression and therefore a release blocker.

by Ivan Sagalaev, 13 years ago

Attachment: 16787.diff added

Patch with tests and docs

by Ivan Sagalaev, 13 years ago

Attachment: 16787.2.diff added

Patch with all new included.

by Ivan Sagalaev, 13 years ago

Attachment: 16787.3.diff added

More specific tests

by Ivan Sagalaev, 13 years ago

Attachment: 16787.4.diff added

Fixed some typos, reformulated docstring.

comment:2 by Chris Heisel, 13 years ago

Cc: chris@… added
Type: UncategorizedBug

I'm getting a test failure:

python runtests.py --settings=test_sqlite templates

TemplateSyntaxError: 'subpackage.echo' is not a valid tag library: Template library subpackage.echo not found, tried django.templatetags.subpackage.echo,django.contrib.flatpages.templatetags.subpackage.echo,django.contrib.comments.templatetags.subpackage.echo,django.contrib.admin.templatetags.subpackage.echo,django.contrib.staticfiles.templatetags.subpackage.echo,django.contrib.humanize.templatetags.subpackage.echo,regressiontests.templates.templatetags.subpackage.echo

comment:3 by Tobias McNulty, 13 years ago

Has patch: set
Triage Stage: AcceptedReady for checkin

The patch includes an empty __init__.py file which didn't get added for me when I applied it. Running this fixes it:

touch tests/regressiontests/templates/templatetags/subpackage/__init__.py

I reviewed the patch with Ivan at the sprint today and I'm happy with v4. As he said in the description, this functionality used to exist, so we don't think there's a need for a separate section in the docs explaining it.

comment:4 by Ivan Sagalaev, 13 years ago

BTW does anyone if it's possible to include an empty file in a diff?

comment:5 by Aymeric Augustin, 13 years ago

I did a lot of research on this problem recently and the best solution I've found is to generate the diff with git — but that only works if you apply it with "git apply".

comment:6 by Ivan Sagalaev, 13 years ago

This won't work for me since I use bzr :-). This is the one place where standardizing on svn and patch utility sucks…

by Ivan Sagalaev, 13 years ago

Attachment: 16787.5.diff added

Patch updated to current trunk

comment:7 by Aymeric Augustin, 13 years ago

Resolution: fixed
Status: newclosed

In [17133]:

Fixed #16787 -- Restored the ability to {% load %} template tags libraries within packages. Thanks Ivan Sagalaev for the report and patch.

Note: See TracTickets for help on using tickets.
Back to Top