Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/django/template/__init__.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Negligible formatting changes to ↵Adrian Holovaty2007-12-221-23/+23
| | | | | | django/template/__init__.py -- fixed some spacing issues, renamed NotImplemented to NotImplementedError and changed some 'raise' statements to use callable exceptions instead of the old-style comma technique git-svn-id: http://code.djangoproject.com/svn/django/trunk@6971 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Changed an '== None' to 'is None' in Template.__init__()Adrian Holovaty2007-12-221-1/+1
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@6970 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Moved the various Debug classes in django.template to a ↵Adrian Holovaty2007-12-221-93/+2
| | | | | | new module, debug.py, so they're only loaded if DEBUG=True. This led to a DEBUG=False memory savings of one 4-KB memory block on my machine, according to ps git-svn-id: http://code.djangoproject.com/svn/django/trunk@6969 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #6057 -- Mark rendered template output as safe for ↵Malcolm Tredinnick2007-11-301-1/+1
| | | | | | auto-escaping purposes. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6778 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #5890 -- fixed the far edge-case of allowing ↵Malcolm Tredinnick2007-11-281-2/+2
| | | | | | | | | | | constant strings inside template template markers: we now treat embedded, escaped double quotes consistently with constant string arguments to filters. Patch from Dmitri Fedortchenko. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6724 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #5945 -- Treat string literals in template filter ↵Malcolm Tredinnick2007-11-171-2/+2
| | | | | | | | | arguments as safe strings for auto-escaping purposes. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6680 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #4713 -- Fixed handling of _() in template tag ↵Malcolm Tredinnick2007-11-171-3/+11
| | | | | | | | | arguments. Based on patched from Indy and SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6679 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Implemented auto-escaping of variable output in ↵Malcolm Tredinnick2007-11-141-25/+45
| | | | | | | | | | | | | | templates. Fully controllable by template authors and it's possible to write filters and templates that simulataneously work in both auto-escaped and non-auto-escaped environments if you need to. Fixed #2359 See documentation in templates.txt and templates_python.txt for how everything works. Backwards incompatible if you're inserting raw HTML output via template variables. Based on an original design from Simon Willison and with debugging help from Michael Radziej. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6671 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #3453: introduced a new template variable ↵Jacob Kaplan-Moss2007-09-211-46/+106
| | | | | | | | | resolution system by Brian Harring (thanks!). The upshot is that variable resolution is about 25% faster, and you should see a measurable performance increase any time you've got long or deeply nested loops. Variable resolution has changed behind the scenes -- see the note in templates_python.txt -- but template.resolve_variable() still exists. This should be fully backwards-compatible. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6399 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #3036 -- Fixed some doctest strings that were ↵Russell Keith-Magee2007-09-151-16/+11
| | | | | | failing. Thanks to pterk for the original patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6268 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #5445: added some compatibility code for the lack ↵Jacob Kaplan-Moss2007-09-141-1/+2
| | | | | | of __iter__ in Jython 2.2. Thanks, Leo Soto. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6211 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #4772 -- Fixed reverse URL creation to work with ↵Malcolm Tredinnick2007-07-071-2/+2
| | | | | | | | | | non-ASCII arguments. Also included a test for non-ASCII strings in URL patterns, although that already worked correctly. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5630 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Merged Unicode branch into trunk (r4952:5608). This ↵Malcolm Tredinnick2007-07-041-20/+21
| | | | | | | | | | | should be fully backwards compatible for all practical purposes. Fixed #2391, #2489, #2996, #3322, #3344, #3370, #3406, #3432, #3454, #3492, #3582, #3690, #3878, #3891, #3937, #4039, #4141, #4227, #4286, #4291, #4300, #4452, #4702 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5609 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Backed out the changes in [5482] for a bit whilst some ↵Malcolm Tredinnick2007-06-221-57/+28
| | | | | | | | | more investigation into side-effects is done. Refs #4565. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5511 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Trivial formatting changes.Malcolm Tredinnick2007-06-171-4/+0
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@5486 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #4565 -- Changed template rendering to use ↵Malcolm Tredinnick2007-06-171-27/+57
| | | | | | | | | | iterators, rather than creating large strings, as much as possible. This is all backwards compatible. Thanks, Brian Harring. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5482 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #4378 -- Fixed a broken format string.Malcolm Tredinnick2007-05-241-1/+1
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@5333 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #3753 -- Allow optional display of invalid ↵Malcolm Tredinnick2007-05-081-0/+9
| | | | | | | | | variable name in TEMPLATE_STRING_IF_INVALID. Thanks, Matt McClanahan. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5167 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #4180 -- Fixed docstring typo noticed by Gary Wilson.Malcolm Tredinnick2007-04-281-1/+1
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@5117 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #4176 -- Fixed unintended change introduced in ↵Malcolm Tredinnick2007-04-281-1/+1
| | | | | | | | | [5104]. Thanks, SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5116 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Minor tweak. Removed unnecessary argument default.Malcolm Tredinnick2007-04-271-1/+1
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@5105 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #4164, #4171 -- Reworked some of the template ↵Malcolm Tredinnick2007-04-271-19/+28
| | | | | | | | | lexer logic to ensure we don't get caught out by a couple of corner cases. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5104 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #4040 -- Changed uses of has_key() to "in". Slight ↵Malcolm Tredinnick2007-04-261-1/+1
| | | | | | | | | | performance improvement and forward-compatible with future Python releases. Patch from Gary Wilson. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5091 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #3948 -- Added some extra relevant information to ↵Malcolm Tredinnick2007-04-251-3/+3
| | | | | | | | | FilterExpression parse-related error message. Thanks, philippe.raoult@gmail.com. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5067 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #3670 -- Fixed template argument parsing so that ↵Malcolm Tredinnick2007-03-091-5/+4
| | | | | | | | | it understands negative floats and integers as numeric types. Patch from SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4690 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #3465: template variable lookups like {{ foobar.13 ↵Jacob Kaplan-Moss2007-02-271-1/+5
| | | | | | }} now (correctly) fail silently on unsubscriptable objects. Thanks, Gary Wilson. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4639 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #3558: [4558] broken in Python 2.3; this fixes ↵Jacob Kaplan-Moss2007-02-241-6/+6
| | | | | | that breakage. Thanks for the heads-up, xian@mintchaos.com git-svn-id: http://code.djangoproject.com/svn/django/trunk@4562 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #343: filters that take strings now handle ↵Jacob Kaplan-Moss2007-02-231-0/+2
| | | | | | non-strings correctly. Thanks to Boffbowsh for the original patch, and to SmileyChris for the updated patch and tests. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4558 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #3468 -- fixed typo in ↵Malcolm Tredinnick2007-02-091-1/+1
| | | | | | | | | VariableDoesNotExist.__str__. Pointed out by Herbert Poul. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4465 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #3441: VariableDoesNotExist is now a bit lazier ↵Jacob Kaplan-Moss2007-02-061-2/+8
| | | | | | about rendering its error message. Thanks, Brian Harring. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4461 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Template system now supports variables whose str() ↵Adrian Holovaty2006-12-051-1/+5
| | | | | | returns a Unicode object with non-ascii characters. Thanks, gabor git-svn-id: http://code.djangoproject.com/svn/django/trunk@4161 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #2343: Library.inclusion_tag now accepts a list of ↵Jacob Kaplan-Moss2006-11-071-2/+5
| | | | | | template names along with a single name. Thanks, mderk@yandex.ru git-svn-id: http://code.djangoproject.com/svn/django/trunk@4038 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #2968 -- Changed arguments to __import__ to use ↵Adrian Holovaty2006-10-301-1/+1
| | | | | | empty dictionary instead of empty string, for stricter compliance with Python library reference. Thanks for the patch, Yasushi Masuda git-svn-id: http://code.djangoproject.com/svn/django/trunk@3951 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #648 -- Added comment syntax to template system: ↵Adrian Holovaty2006-10-241-4/+10
| | | | | | {# #}. Thanks for the patch, mccutchen@gmail.com and Hawkeye git-svn-id: http://code.djangoproject.com/svn/django/trunk@3931 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #2208 -- Allow empty arguments to be passed to ↵Malcolm Tredinnick2006-09-261-1/+1
| | | | | | filters. Thanks, mattmcc. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3852 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #2645 -- Fixed format-string error in exception ↵Adrian Holovaty2006-09-051-1/+1
| | | | | | call in template/__init__.py. Thanks for the patch, md@hudora.de git-svn-id: http://code.djangoproject.com/svn/django/trunk@3720 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixes #2637 -- Clarified handling of ↵Russell Keith-Magee2006-09-041-2/+5
| | | | | | TEMPLATE_STRING_IF_INVALID, especially with regards to filtering of invalid values. Modified unit tests to test both empty and non-empty values for TEMPLATE_STRING_IF_INVALID. Thanks to SmileyChris for identifying and helping to resolve this bug. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3714 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Refs #2333 - Added documentation for the test Client, ↵Russell Keith-Magee2006-09-031-1/+0
| | | | | | and removed a stray import. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3711 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Refs #2333 - Removed a call to the signal dispatcher ↵Russell Keith-Magee2006-09-021-2/+0
| | | | | | that was mistakenly merged in. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3709 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Refs #2333 - Re-added the template rendering signal for ↵Russell Keith-Magee2006-09-021-1/+5
| | | | | | testing purposes; however, the signal is not available during normal operation. It is only added as part of an instrumentation step that occurs during test framework setup. Previous attempt (r3659) was reverted (r3666) due to performance concerns. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3707 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Refs #1400 - Reverted r3269. Template variable evalution ↵Russell Keith-Magee2006-08-301-5/+1
| | | | | | should follow Python norms. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3680 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Reverted [3659], the 'name' field on Template objects ↵Adrian Holovaty2006-08-271-5/+1
| | | | | | and the signal emitted whenever a template is rendered. Refs #2333. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3666 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Refs #2333 - Added a signal that is emitted whenever a ↵Russell Keith-Magee2006-08-271-1/+5
| | | | | | template is rendered, and added a 'name' field to Template to allow easy identification of templates. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3659 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Negligible formatting change to django/template/__init__.pyAdrian Holovaty2006-07-251-1/+1
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@3449 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Second half of little cleanup tweaks suggested by pyflakes.Jacob Kaplan-Moss2006-07-211-1/+1
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@3414 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #1647 -- Included slightly more information in ↵Malcolm Tredinnick2006-07-191-2/+2
| | | | | | | | | template syntax error displays in DebugNodeList. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3375 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #2320 -- corrected numerous errors in the custom ↵Malcolm Tredinnick2006-07-101-2/+2
| | | | | | | | | tag examples in python_templates.txt. Also fixed an argument parsing error for such tags. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3308 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #2303 -- Fixed bug in [3269] with regard to True ↵Adrian Holovaty2006-07-081-2/+2
| | | | | | and False special-casing in template system git-svn-id: http://code.djangoproject.com/svn/django/trunk@3294 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Refs #1400 -- Variable resolver now converts literal ↵Russell Keith-Magee2006-07-041-1/+5
| | | | | | strings 'False' and 'True' into booleans when used as template arguments. This is point 2 from ticket #1400. Thanks Kieren Holland. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3269 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixes #1338, Refs #1400, #2237 -- Modified variable ↵Russell Keith-Magee2006-07-041-3/+6
| | | | | | resolution to allow template 'if' statements to work if TEMPLATE_STRING_IF_INVALID is set. Modified unit tests to force the use of this variable, so that returning '' isn't confused with an actual failure. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3268 bcc190cf-cafb-0310-a4f2-bffc1f526a37