Changes between Version 266 and Version 267 of BackwardsIncompatibleChanges
- Timestamp:
- Sep 24, 2008, 6:50:31 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BackwardsIncompatibleChanges
v266 v267 96 96 }}} 97 97 should be modified to read: 98 98 99 99 100 … … 413 414 The second and probably more robust way is to use {{{mark_safe()}}} where appropriate (see [http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#filters-and-auto-escaping the documentation] for details) and go through each of your custom filters attaching {{{is_safe}}} and {{{needs_autoescape}}} attributes where necessary (again, the details are in the above documentation). 414 415 415 Have a look at Django's default filters (in {{{django/template/defaultfilters.py}}}) for examples of how mixed filters (those which behave differently depending upon whether auto-escaping is in effect o /r not) can be written.416 Have a look at Django's default filters (in {{{django/template/defaultfilters.py}}}) for examples of how mixed filters (those which behave differently depending upon whether auto-escaping is in effect or not) can be written. 416 417 417 418 The attributes on filter functions and the new {{{escape}}} behaviour mean that you can write templates and filters that will operate correctly in both auto-escaping and non-auto-escaping environments, so you're not forcing your decision onto users of your filters, if you distribute the code.