summaryrefslogtreecommitdiff
path: root/django/template
AgeCommit message (Collapse)Author
2008-02-04Allow whitespace prior to an "extends" tag. This allows a little more ↵Malcolm Tredinnick
formatting flexibility. Refs #6274. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7082 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-28Fixed #6471 -- Fixed stringfilter decoration of `force_escape` filter.Gary Wilson Jr
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7033 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-06Fixed #5567 -- Added a "last" filter. Based on a patch from darkpixel.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6998 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-06The "first" filter can return an unsafe string for safe input ( ↵Malcolm Tredinnick
{{"<"|first}} ), so change is_safe to False. Refs #5567. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6997 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-05Reverted 'regroup' template tag changes from [6956], as they caused bug ↵Adrian Holovaty
#6271, which affects one of my sites. I don't have time to inspect the #6271 patch, so I'm reverting this change in the interim, to fix the bug immediately. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6996 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-02Fixed #6295 -- Made the {% for %} tag a bit more efficient by creating a ↵Adrian Holovaty
single context dictionary rather than recreating it each time through the loop. Thanks, Ned Batchelder git-svn-id: http://code.djangoproject.com/svn/django/trunk@6981 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-22Renamed 'reversed' variable to 'is_reversed' in ForLoop template tag ↵Adrian Holovaty
implementation, to avoid potential conflicts with the 'reversed' built-in and to make the code more obvious git-svn-id: http://code.djangoproject.com/svn/django/trunk@6976 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-22Negligible cleanups to django.template.contextAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6975 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-22Negligible changes to django.template -- removed a useless docstring, ↵Adrian Holovaty
converted another one to a comment git-svn-id: http://code.djangoproject.com/svn/django/trunk@6974 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-22Removed lexer_factory() and parser_factory() functions in django.template, ↵Adrian Holovaty
simplifying the compile_string() logic git-svn-id: http://code.djangoproject.com/svn/django/trunk@6973 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-22Removed a comment in django/template/__init__.py that suggests we would do ↵Adrian Holovaty
'crazy stack-frame stuff' git-svn-id: http://code.djangoproject.com/svn/django/trunk@6972 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-22Negligible formatting changes to django/template/__init__.py -- fixed some ↵Adrian Holovaty
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
2007-12-22Changed an '== None' to 'is None' in Template.__init__()Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6970 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-22Moved the various Debug classes in django.template to a new module, ↵Adrian Holovaty
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
2007-12-19Removed some reverse string craziness from the regroup template tag argument ↵Gary Wilson Jr
checking and added a few syntax tests. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6956 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-19Fixed #6239 -- Fixed an auto-escaping problem with urlizetrunc. Thanks, ↵Malcolm Tredinnick
SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6950 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-17Small typo fixes. Thanks, jdetaeye, Ionut Ciocirlan, David Reynolds and adamv.Malcolm Tredinnick
Fixed #6123, #6133, #6179, #6194. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6923 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-05Fixed #6132: note to self: when you add new template tags, you need to ↵Jacob Kaplan-Moss
remember to actually register them. Thanks, Ben Walton. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6897 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-04Fixed #4131: added an "escapejs" filter for use in JavaScript strings, and ↵Jacob Kaplan-Moss
updated the documentation on addslashes to point to the new ticket. Featuring contributions from Ned Batchelder, Jeremy Dunck, and Andy Durdin. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6892 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-02Fixed #4563 -- Context.pop/push/update return the top-level dictionary (the newMalcolm Tredinnick
one for push() and update(), the one removed for pop()). Based on a patch from Brian Harring. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6854 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-01Edited docs/serialization.txt changes from [6645]Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6787 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-30Fixed #6057 -- Mark rendered template output as safe for auto-escaping purposes.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6778 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-29Fixed #6030 -- More robust error handling for the "float" filter. Thanks,Malcolm Tredinnick
SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6752 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-29Added tests and a small optimisation for [6721]. Thanks SmileyChris. Fixed #6049Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6729 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-28Fixed #5890 -- fixed the far edge-case of allowing constant strings insideMalcolm Tredinnick
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
2007-11-28Fixed an edge-case for auto-escaping: if the stringfilter decorator is used andMalcolm Tredinnick
generates a first argument that is a safe string, make the is_safe handling work as expect. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6721 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-20Fixed #5983 -- Made iriencode filter respect safe strings. Patch fromMalcolm Tredinnick
SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6706 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-17Fixed #5945 -- Treat string literals in template filter arguments as safeMalcolm Tredinnick
strings for auto-escaping purposes. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6680 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-17Fixed #4713 -- Fixed handling of _() in template tag arguments. Based onMalcolm Tredinnick
patched from Indy and SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6679 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-14Content coming via {{ block.super }} is always going to be correctly escapedMalcolm Tredinnick
already. We mark it as safe so that template authors don't need to. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6673 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-14Implemented auto-escaping of variable output in templates. Fully ↵Malcolm Tredinnick
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
2007-11-04`floatformat` template filter docstring changes:Gary Wilson Jr
* Split example cases. * Corrected use with negative arguments (quotes are needed). * Added another example of a number that has decimal places that include a non-zero digit and that ends with zeros. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6646 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-04Added examples to the `pluralize` template filter's docstring.Gary Wilson Jr
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6643 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-04Style and import fixes.Gary Wilson Jr
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6641 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-03Made use of `itertools.cycle` for the `cycle` template tag.Gary Wilson Jr
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6636 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-20Fixed #4123 -- Changed the firstof template tag to correctly handle a literalMalcolm Tredinnick
string as its last argument. Thanks, Wesley Fok and Matt Boersma. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6571 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-20Fixed a markup problem in the docstring for the "if" tag. This was showing upMalcolm Tredinnick
in the admin docs. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-21Fixed #3453: introduced a new template variable resolution system by Brian ↵Jacob Kaplan-Moss
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
2007-09-15Fixed #5243 -- Allow loading of templatetags from subdirectories (via dotted ↵Malcolm Tredinnick
notation in {% load %}). Thanks, Bjørn Stabell. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6289 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15Fixed #3036 -- Fixed some doctest strings that were failing. Thanks to pterk ↵Russell Keith-Magee
for the original patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6268 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14Fixed #4658 -- Improved documentation of linebreaks and linebreaksbr. ↵Adrian Holovaty
Thanks, ubernostrum and Gary Wilson git-svn-id: http://code.djangoproject.com/svn/django/trunk@6223 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14Fixed #5445: added some compatibility code for the lack of __iter__ in ↵Jacob Kaplan-Moss
Jython 2.2. Thanks, Leo Soto. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6211 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14Fixed #208 -- Modernized the syntax of the cycle tag to allow for spaces and ↵Russell Keith-Magee
variables in cycle values. Thanks to SmileyChris and Chris McAvoy for their work on this. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6153 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-11Refs #5138 -- Refactored implementation of __contains__ in HttpRequest ↵Russell Keith-Magee
introduced in [6097] after a suggestion from Malcolm. Applied a similar refactor for MergeDict and Context which had comparable behavior. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6098 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-26Fixed #3184 -- Changed the `unordered_list` template filter to use a more ↵Gary Wilson Jr
simple format, while maintaining backwards compatibility with the old format. `unordered_list` now works with a simple list of items. Thanks for the patch, SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6019 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-18Fixed #5187 -- Minor doc tweaks. Thanks, Daniel Hahler.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5927 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-06Fixed #5006 -- Fixed incorrect/outdated docstring for the 'if' template tag. ↵Adrian Holovaty
Thanks, Thomas Petazzoni git-svn-id: http://code.djangoproject.com/svn/django/trunk@5815 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-23Fixed #4952 -- Fixed the `get_template_sources` functions of the ↵Gary Wilson Jr
`app_directories` and `filesystem` template loaders to not return paths outside of given template directories. Both functions now make use of a new `safe_join` utility function. Thanks to SmileyChris for help with the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5750 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-13Fixed #4842 -- Added slightly more robust error reporting. Thanks, ThomasMalcolm Tredinnick
Güttler. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5682 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-07Fixed #4772 -- Fixed reverse URL creation to work with non-ASCII arguments.Malcolm Tredinnick
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