Changeset 5048
- Timestamp:
- 04/20/07 23:13:52 (2 years ago)
- Files:
-
- django/trunk/django/template/defaulttags.py (modified) (2 diffs)
- django/trunk/tests/regressiontests/templates/tests.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/template/defaulttags.py
r4909 r5048 991 991 Add a value to the context (inside of this block) for caching and easy 992 992 access. 993 993 994 994 For example:: 995 995 … … 1000 1000 bits = list(token.split_contents()) 1001 1001 if len(bits) != 4 or bits[2] != "as": 1002 raise TemplateSyntaxError, "%r expected format is 'value as name'" % tagname1002 raise TemplateSyntaxError, "%r expected format is 'value as name'" % bits[0] 1003 1003 var = parser.compile_filter(bits[1]) 1004 1004 name = bits[3] django/trunk/tests/regressiontests/templates/tests.py
r4901 r5048 655 655 'with02': ('{{ key }}{% with dict.key as key %}{{ key }}-{{ dict.key }}-{{ key }}{% endwith %}{{ key }}', {'dict': {'key':50}}, ('50-50-50', 'INVALID50-50-50INVALID')), 656 656 657 'with-error01': ('{% with dict.key xx key %}{{ key }}{% endwith %}', {'dict': {'key':50}}, template.TemplateSyntaxError), 658 'with-error02': ('{% with dict.key as %}{{ key }}{% endwith %}', {'dict': {'key':50}}, template.TemplateSyntaxError), 659 657 660 ### NOW TAG ######################################################## 658 661 # Simple case
