Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #2961 -- Added 'opencomment' and 'closecomment' options to {% t…

…emplatetag %} templatetag. Thanks for the patch, Jeong-Min Lee

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3938 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 48234a0925fcba67a72d3cfc31fbf66cca3f2e33 1 parent ed27ff9
@adrianholovaty adrianholovaty authored
View
2  AUTHORS
@@ -106,7 +106,7 @@ answer newbie questions, and generally made Django that much better:
lakin.wecker@gmail.com
Stuart Langridge <http://www.kryogenix.org/>
Eugene Lazutkin <http://lazutkin.com/blog/>
- Jeong-Min Lee
+ Jeong-Min Lee <falsetru@gmail.com>
Christopher Lenz <http://www.cmlenz.net/>
lerouxb@gmail.com
limodou
View
6 django/template/defaulttags.py
@@ -1,7 +1,7 @@
"Default tags used by the template system, available to all templates."
from django.template import Node, NodeList, Template, Context, resolve_variable
-from django.template import TemplateSyntaxError, VariableDoesNotExist, BLOCK_TAG_START, BLOCK_TAG_END, VARIABLE_TAG_START, VARIABLE_TAG_END, SINGLE_BRACE_START, SINGLE_BRACE_END
+from django.template import TemplateSyntaxError, VariableDoesNotExist, BLOCK_TAG_START, BLOCK_TAG_END, VARIABLE_TAG_START, VARIABLE_TAG_END, SINGLE_BRACE_START, SINGLE_BRACE_END, COMMENT_TAG_START, COMMENT_TAG_END
from django.template import get_library, Library, InvalidTemplateLibrary
from django.conf import settings
import sys
@@ -295,6 +295,8 @@ class TemplateTagNode(Node):
'closevariable': VARIABLE_TAG_END,
'openbrace': SINGLE_BRACE_START,
'closebrace': SINGLE_BRACE_END,
+ 'opencomment': COMMENT_TAG_START,
+ 'closecomment': COMMENT_TAG_END,
}
def __init__(self, tagtype):
@@ -831,6 +833,8 @@ def templatetag(parser, token):
``closevariable`` ``}}``
``openbrace`` ``{``
``closebrace`` ``}``
+ ``opencomment`` ``{#``
+ ``closecomment`` ``#}``
================== =======
"""
bits = token.contents.split()
View
4 docs/templates.txt
@@ -800,8 +800,12 @@ The argument tells which template bit to output:
``closevariable`` ``}}``
``openbrace`` ``{``
``closebrace`` ``}``
+ ``opencomment`` ``{#``
+ ``closecomment`` ``#}``
================== =======
+Note: ``opencomment`` and ``closecomment`` are new in the Django development version.
+
widthratio
~~~~~~~~~~
View
2  tests/regressiontests/templates/tests.py
@@ -552,6 +552,8 @@ def test_templates(self):
'templatetag08': ('{% templatetag closebrace %}', {}, '}'),
'templatetag09': ('{% templatetag openbrace %}{% templatetag openbrace %}', {}, '{{'),
'templatetag10': ('{% templatetag closebrace %}{% templatetag closebrace %}', {}, '}}'),
+ 'templatetag11': ('{% templatetag opencomment %}', {}, '{#'),
+ 'templatetag12': ('{% templatetag closecomment %}', {}, '#}'),
### WIDTHRATIO TAG ########################################################
'widthratio01': ('{% widthratio a b 0 %}', {'a':50,'b':100}, '0'),

0 comments on commit 48234a0

Please sign in to comment.
Something went wrong with that request. Please try again.