Re: DJANGO 1.0 : How to avoid converting to entities

2008-09-21 Thread Ivan Sagalaev
Malcolm Tredinnick wrote: >> Better yet, the thing that creates colorizedCode should mark it as >> "safe" (i.e. not requiring escaping) in this fashion: >> >> from django.utils.safestring import mark_safe >> def colorize(): >> # ... >> return mark_safe(result) > > Alt

Re: DJANGO 1.0 : How to avoid converting to entities

2008-09-20 Thread Malcolm Tredinnick
On Sat, 2008-09-20 at 20:42 +0400, Ivan Sagalaev wrote: > tsmets wrote: > > OK ! > > I found it : http://code.djangoproject.com/wiki/AutoEscaping > > > > {% autoescape off %} > > {{ body }} > > {% endautoescape %} > > Or just {{ body|safe }}. > > Better yet, the thing that creates colorizedCod

Re: DJANGO 1.0 : How to avoid converting to entities

2008-09-20 Thread Ivan Sagalaev
tsmets wrote: > OK ! > I found it : http://code.djangoproject.com/wiki/AutoEscaping > > {% autoescape off %} > {{ body }} > {% endautoescape %} Or just {{ body|safe }}. Better yet, the thing that creates colorizedCode should mark it as "safe" (i.e. not requiring escaping) in this fashion:

Re: DJANGO 1.0 : How to avoid converting to entities

2008-09-20 Thread Erik Allik
djangobook.com is outdated. It states that it covers "0.96 and higher", but the "and higher" part is misleading because it doesn't cover 1.0 as far as I know. Erik On 20.09.2008, at 15:49, tsmets wrote: > > OK ! > I found it : http://code.djangoproject.com/wiki/AutoEscaping > > {% autoescap

Re: DJANGO 1.0 : How to avoid converting to entities

2008-09-20 Thread tsmets
OK ! I found it : http://code.djangoproject.com/wiki/AutoEscaping {% autoescape off %} {{ body }} {% endautoescape %} \T, ps : It seems I did not find it in the django book either --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: DJANGO 1.0 : How to avoid converting to entities

2008-09-20 Thread Erik Allik
Django auto-escapes all variable output in templates. You can read the docs about this. Erik On 20.09.2008, at 15:32, tsmets wrote: > > > I am writting a home brewed version of http://dpaste.com > I manage to convert/colorize most the code with pygment. > > However when I print the content of

DJANGO 1.0 : How to avoid converting to entities

2008-09-20 Thread tsmets
I am writting a home brewed version of http://dpaste.com I manage to convert/colorize most the code with pygment. However when I print the content of the "colorized" code in the function, I have the correct html code as colorized by pygment. Then I do : [code] return render_to_response('dpas