<feed xmlns='http://www.w3.org/2005/Atom'>
<title>chango.git/django/template/debug.py, branch devmain</title>
<subtitle>django
</subtitle>
<id>http://cgit.adnoto.dev/chango.git/atom?h=devmain</id>
<link rel='self' href='http://cgit.adnoto.dev/chango.git/atom?h=devmain'/>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/'/>
<updated>2015-03-20T12:58:07Z</updated>
<entry>
<title>Cleaned up the template debug implementation.</title>
<updated>2015-03-20T12:58:07Z</updated>
<author>
<name>Preston Timmons</name>
<email>prestontimmons@gmail.com</email>
</author>
<published>2015-03-06T15:53:25Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/commit/?id=55f12f8709f0604df7e1817a4c114ead1fb9a311'/>
<id>urn:sha1:55f12f8709f0604df7e1817a4c114ead1fb9a311</id>
<content type='text'>
This patch does three major things:

* Merges the django.template.debug implementation into django.template.base.

* Simplifies the debug implementation.

  The old implementation copied debug information to every token and node.
  The django_template_source attribute was set in multiple places, some
  quite hacky, like django.template.defaulttags.ForNode.

  Debug information is now annotated in two high-level places:

  * Template.compile_nodelist for errors during parsing
  * Node.render_annotated for errors during rendering

  These were chosen because they have access to the template and context
  as well as to all exceptions that happen during either the parse or
  render phase.

* Moves the contextual line traceback information creation from
  django.views.debug into django.template.base.Template. The debug views now
  only deal with the presentation of the debug information.
</content>
</entry>
<entry>
<title>Removed unnecessary __init__ definition from DebugLexer.</title>
<updated>2015-02-16T18:00:02Z</updated>
<author>
<name>Preston Timmons</name>
<email>prestontimmons@gmail.com</email>
</author>
<published>2015-02-16T15:36:35Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/commit/?id=ad9ecc2c209df3a48fc607f886d57f77ef972546'/>
<id>urn:sha1:ad9ecc2c209df3a48fc607f886d57f77ef972546</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Sorted imports with isort; refs #23860.</title>
<updated>2015-02-06T13:16:28Z</updated>
<author>
<name>Tim Graham</name>
<email>timograham@gmail.com</email>
</author>
<published>2015-01-28T12:35:27Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/commit/?id=0ed7d155635da9f79d4dd67e4889087d3673c6da'/>
<id>urn:sha1:0ed7d155635da9f79d4dd67e4889087d3673c6da</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fixed #23831 -- Supported strings escaped by third-party libs in Django.</title>
<updated>2014-12-27T17:02:34Z</updated>
<author>
<name>Aymeric Augustin</name>
<email>aymeric.augustin@m4x.org</email>
</author>
<published>2014-12-23T21:29:01Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/commit/?id=6d52f6f8e688b5c4e70be8352eb02c05fea60e85'/>
<id>urn:sha1:6d52f6f8e688b5c4e70be8352eb02c05fea60e85</id>
<content type='text'>
Refs #7261 -- Made strings escaped by Django usable in third-party libs.

The changes in mark_safe and mark_for_escaping are straightforward. The
more tricky part is to handle correctly objects that implement __html__.

Historically escape() has escaped SafeData. Even if that doesn't seem a
good behavior, changing it would create security concerns. Therefore
support for __html__() was only added to conditional_escape() where this
concern doesn't exist.

Then using conditional_escape() instead of escape() in the Django
template engine makes it understand data escaped by other libraries.

Template filter |escape accounts for __html__() when it's available.
|force_escape forces the use of Django's HTML escaping implementation.

Here's why the change in render_value_in_context() is safe. Before Django
1.7 conditional_escape() was implemented as follows:

    if isinstance(text, SafeData):
        return text
    else:
        return escape(text)

render_value_in_context() never called escape() on SafeData. Therefore
replacing escape() with conditional_escape() doesn't change the
autoescaping logic as it was originally intended.

This change should be backported to Django 1.7 because it corrects a
feature added in Django 1.7.

Thanks mitsuhiko for the report.
</content>
</entry>
<entry>
<title>More attacking E302 violators</title>
<updated>2013-11-02T20:12:09Z</updated>
<author>
<name>Alex Gaynor</name>
<email>alex.gaynor@gmail.com</email>
</author>
<published>2013-11-02T20:12:09Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/commit/?id=7548aa8ffd46eb6e0f73730d1b2eb515ba581f95'/>
<id>urn:sha1:7548aa8ffd46eb6e0f73730d1b2eb515ba581f95</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fixed #21266 -- Fixed E201,E202 pep8 warnings.</title>
<updated>2013-10-14T22:12:00Z</updated>
<author>
<name>Larry O'Neill</name>
<email>larryoneill@gmail.com</email>
</author>
<published>2013-10-14T19:13:14Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/commit/?id=83b9bfea44e23c5770fa14a8921914839929233b'/>
<id>urn:sha1:83b9bfea44e23c5770fa14a8921914839929233b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fixed #19819 - Improved template filter errors handling.</title>
<updated>2013-02-14T09:22:59Z</updated>
<author>
<name>Michael van Tellingen</name>
<email>michaelvantellingen@gmail.com</email>
</author>
<published>2013-02-14T08:45:55Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/commit/?id=138de533ff677b470a1e7b4b6ff084a5b7a7444b'/>
<id>urn:sha1:138de533ff677b470a1e7b4b6ff084a5b7a7444b</id>
<content type='text'>
Wrap the Parser.compile_filter method call with a try/except and call the
newly added Parser.compile_filter_error(). Overwrite this method in the
DebugParser to throw the correct error.

Since this error was otherwise catched by the compile_function try/except
block the debugger highlighted the wrong line.
</content>
</entry>
<entry>
<title>[py3] Ported django.utils.encoding.</title>
<updated>2012-08-07T10:00:22Z</updated>
<author>
<name>Aymeric Augustin</name>
<email>aymeric.augustin@m4x.org</email>
</author>
<published>2012-07-21T08:00:10Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/commit/?id=c5ef65bcf324f4c90b53be90f4aec069a68e8c59'/>
<id>urn:sha1:c5ef65bcf324f4c90b53be90f4aec069a68e8c59</id>
<content type='text'>
* Renamed smart_unicode to smart_text (but kept the old name under
  Python 2 for backwards compatibility).
* Renamed smart_str to smart_bytes.
* Re-introduced smart_str as an alias for smart_text under Python 3
  and smart_bytes under Python 2 (which is backwards compatible).
  Thus smart_str always returns a str objects.
* Used the new smart_str in a few places where both Python 2 and 3
  want a str.
</content>
</entry>
<entry>
<title>Fixed #18013 -- Use the new 'as' syntax for exceptions.</title>
<updated>2012-04-29T18:57:15Z</updated>
<author>
<name>Claude Paroz</name>
<email>claude@2xlibre.net</email>
</author>
<published>2012-04-28T16:09:37Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/commit/?id=3904b74a3f2f92fefe1d39281ed683c52f2fef03'/>
<id>urn:sha1:3904b74a3f2f92fefe1d39281ed683c52f2fef03</id>
<content type='text'>
Thanks Clueless for the initial patch.
Note that unittest has been purposely left out (external package only used by Python 2.6).
</content>
</entry>
<entry>
<title>Fixed #17992 -- Added a public API for localtime.</title>
<updated>2012-04-29T13:37:23Z</updated>
<author>
<name>Aymeric Augustin</name>
<email>aymeric.augustin@m4x.org</email>
</author>
<published>2012-04-29T13:37:23Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/commit/?id=3e8b40f479a02e0f8c40ef3c7dae740082478b89'/>
<id>urn:sha1:3e8b40f479a02e0f8c40ef3c7dae740082478b89</id>
<content type='text'>
Thanks Bradley Ayers for the report.
</content>
</entry>
</feed>
