magic-removal: Merged to [1964]
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1965 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
0b5043832b
commit
08f032f6b5
|
@ -3,7 +3,7 @@
|
|||
by Wilson Miner (wminer@ljworld.com). Copyright 2004-2005 Lawrence Journal-World
|
||||
*/
|
||||
|
||||
body { margin:0; padding:0; font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif; color:#333; }
|
||||
body { margin:0; padding:0; font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif; color:#333; background:#fff; }
|
||||
|
||||
/* LINKS */
|
||||
a:link, a:visited { color: #5b80b2; text-decoration:none; }
|
||||
|
|
|
@ -257,6 +257,13 @@ class Parser(object):
|
|||
self.unclosed_block_tag(parse_until)
|
||||
return nodelist
|
||||
|
||||
def skip_past(self, endtag):
|
||||
while self.tokens:
|
||||
token = self.next_token()
|
||||
if token.token_type == TOKEN_BLOCK and token.contents == endtag:
|
||||
return
|
||||
self.unclosed_block_tag([endtag])
|
||||
|
||||
def create_variable_node(self, filter_expression):
|
||||
return VariableNode(filter_expression)
|
||||
|
||||
|
|
|
@ -286,8 +286,7 @@ def comment(parser, token):
|
|||
"""
|
||||
Ignore everything between ``{% comment %}`` and ``{% endcomment %}``
|
||||
"""
|
||||
nodelist = parser.parse(('endcomment',))
|
||||
parser.delete_first_token()
|
||||
parser.skip_past('endcomment')
|
||||
return CommentNode()
|
||||
comment = register.tag(comment)
|
||||
|
||||
|
|
|
@ -455,8 +455,12 @@ Let's jump back into the Python interactive shell by running
|
|||
What's up?
|
||||
>>> polls.get_object(question__startswith='What')
|
||||
What's up?
|
||||
|
||||
# Get the poll whose year is 2005. Of course, if you're going through this
|
||||
# tutorial in another year, change as appropriate.
|
||||
>>> polls.get_object(pub_date__year=2005)
|
||||
What's up?
|
||||
|
||||
>>> polls.get_object(id__exact=2)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
|
|
|
@ -156,6 +156,11 @@ TEMPLATE_TESTS = {
|
|||
'comment-tag01': ("{% comment %}this is hidden{% endcomment %}hello", {}, "hello"),
|
||||
'comment-tag02': ("{% comment %}this is hidden{% endcomment %}hello{% comment %}foo{% endcomment %}", {}, "hello"),
|
||||
|
||||
# Comment tag can contain invalid stuff.
|
||||
'comment-tag03': ("foo{% comment %} {% if %} {% endcomment %}", {}, "foo"),
|
||||
'comment-tag04': ("foo{% comment %} {% endblock %} {% endcomment %}", {}, "foo"),
|
||||
'comment-tag05': ("foo{% comment %} {% somerandomtag %} {% endcomment %}", {}, "foo"),
|
||||
|
||||
### CYCLE TAG #############################################################
|
||||
#'cycleXX': ('', {}, ''),
|
||||
'cycle01': ('{% cycle a, %}', {}, 'a'),
|
||||
|
|
Loading…
Reference in New Issue