Deryck Hodge wrote:
> On 7/27/06, Jeremy Dunck <[EMAIL PROTECTED]> wrote:
>> Make a setting to turn define the default, and if the setting's not
>> there, auto-escape.
>> Anyone that doesn't want it can just turn it off by defining the setting.
>>
>> AUTO_ESCAPE_TEXT = _True_|False
>
> This is the exact scenario that should be avoided most, which came up
> last time this was discussed. What if I have all the apps on my site
> without auto-escaping by default, but another person's app, which I
> want to incorporate into my site, expects auto-escaping?
>
> Sure, there are work arounds, but a default setting that can be
> toggled on or off is not a sane solution.
Scope it per template:
{% extends "base_generic.html" %}
{% escape %}
This lets people who want auto-escaping, have it, without typing in
"|escape" everywhere or screwing things up site wide with globals.
Alternative, do it in the view code:
def detail(request, poll_id):
p = get_object_or_404(Poll, pk=poll_id)
return render_to_response('detail.html', {'poll': p}, escape=True)
cheers
Bill
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---