Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #30723

Re: How to print html in python the normal way

References <4d096ff3-e25f-400e-89c6-47483aaacc0d@googlegroups.com> <mailman.1791.1349350257.27098.python-list@python.org> <b198f16a-ff25-4a05-a680-d6adb07fdad9@googlegroups.com>
Date 2012-10-04 09:19 -0400
Subject Re: How to print html in python the normal way
From Joel Goldstick <joel.goldstick@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1795.1349356778.27098.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Oct 4, 2012 at 9:11 AM, Ramchandra Apte <maniandram01@gmail.com> wrote:
> On Thursday, 4 October 2012 17:00:57 UTC+5:30, Chris Angelico  wrote:
>> On Thu, Oct 4, 2012 at 9:24 PM,  <ashishjain.ash@gmail.com> wrote:
>>
>> > am I missing something.
>>
>>
You should look at the built in django tags, and learn about them
before writing your own

In this case, look here:
https://docs.djangoproject.com/en/dev/topics/templates/#filters


striptags

    Strips all [X]HTML tags. For example:

    {{ value|striptags }}

    If value is "<b>Joel</b> <button>is</button> a <span>slug</span>",
the output will be "Joel is a slug".

Again, these are just a few examples; see the built-in filter
reference for the complete list.



-- 
Joel Goldstick

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to print html in python the normal way ashishjain.ash@gmail.com - 2012-10-04 04:24 -0700
  Re: How to print html in python the normal way Chris Angelico <rosuav@gmail.com> - 2012-10-04 21:30 +1000
    Re: How to print html in python the normal way Ramchandra Apte <maniandram01@gmail.com> - 2012-10-04 06:11 -0700
      Re: How to print html in python the normal way Joel Goldstick <joel.goldstick@gmail.com> - 2012-10-04 09:19 -0400
    Re: How to print html in python the normal way Ramchandra Apte <maniandram01@gmail.com> - 2012-10-04 06:11 -0700
    Re: How to print html in python the normal way ashishjain.ash@gmail.com - 2012-10-05 01:20 -0700
    Re: How to print html in python the normal way ashishjain.ash@gmail.com - 2012-10-05 01:20 -0700

csiph-web