-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New 0.6 version. Now compatible with Django 1.4
git-svn-id: http://django-smart-extends.googlecode.com/svn/trunk@30 9df5bbc6-2602-82a0-fa3b-af6e0d1beed8
- Loading branch information
msaelices@yaco.es
committed
Nov 7, 2012
1 parent
664693a
commit fb9cb43
Showing
5 changed files
with
75 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
0.6 | ||
--- | ||
|
||
* Compatible with Django 1.4 (need Django patches when DEBUG_TEMPLATE is False) | ||
|
||
0.5.1 | ||
----- | ||
|
||
* Compatible with Django 1.2 and Django 1.3 (need Django patches when DEBUG_TEMPLATE is False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
diff --git a/django/template/base.py b/django/template/base.py | ||
index e2fc66b..09f114b 100644 | ||
--- a/django/template/base.py | ||
+++ b/django/template/base.py | ||
@@ -220,6 +220,7 @@ class Lexer(object): | ||
else: | ||
token = Token(TOKEN_TEXT, token_string) | ||
token.lineno = self.lineno | ||
+ token.source = self.origin, (-1, -1) | ||
self.lineno += token_string.count('\n') | ||
return token | ||
|
||
@@ -297,6 +298,7 @@ class Parser(object): | ||
"in the template." % node) | ||
if isinstance(nodelist, NodeList) and not isinstance(node, TextNode): | ||
nodelist.contains_nontext = True | ||
+ node.source = token.source | ||
nodelist.append(node) | ||
|
||
def enter_command(self, command, token): | ||
diff --git a/django/template/debug.py b/django/template/debug.py | ||
index 74aa82b..8289cc3 100644 | ||
--- a/django/template/debug.py | ||
+++ b/django/template/debug.py | ||
@@ -55,10 +55,6 @@ class DebugParser(Parser): | ||
def create_variable_node(self, contents): | ||
return DebugVariableNode(contents) | ||
|
||
- def extend_nodelist(self, nodelist, node, token): | ||
- node.source = token.source | ||
- super(DebugParser, self).extend_nodelist(nodelist, node, token) | ||
- | ||
def unclosed_block_tag(self, parse_until): | ||
command, source = self.command_stack.pop() | ||
msg = "Unclosed tag '%s'. Looking for one of: %s " % (command, ', '.join(parse_until)) | ||
diff --git a/django/template/loader.py b/django/template/loader.py | ||
index 4185017..82f2ead 100644 | ||
--- a/django/template/loader.py | ||
+++ b/django/template/loader.py | ||
@@ -79,10 +79,9 @@ class LoaderOrigin(Origin): | ||
return self.loader(self.loadname, self.dirs)[0] | ||
|
||
def make_origin(display_name, loader, name, dirs): | ||
- if settings.TEMPLATE_DEBUG and display_name: | ||
+ if display_name: | ||
return LoaderOrigin(display_name, loader, name, dirs) | ||
- else: | ||
- return None | ||
+ return None | ||
|
||
def find_template_loader(loader): | ||
if isinstance(loader, (tuple, list)): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters