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

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <joel.goldstick@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'example:': 0.03; 'output': 0.04; 'subject:How': 0.09; 'cc:addr:python-list': 0.10; 'django': 0.10; 'subject:python': 0.11; 'oct': 0.16; 'tags.': 0.16; 'url:djangoproject': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'url:dev': 0.17; 'received:74.125.82.174': 0.23; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header :In-Reply-To:1': 0.25; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'chris': 0.28; 'case,': 0.29; 'thursday,': 0.30; 'received:74.125.82': 0.33; 'received:google.com': 0.34; 'built- in': 0.35; 'filter': 0.35; 'pm,': 0.35; 'list.': 0.35; 'received:74.125': 0.36; 'should': 0.36; 'october': 0.37; 'subject:: ': 0.38; 'url:docs': 0.38; 'url:en': 0.38; 'header:Received:5': 0.40; 'your': 0.60; 'here:': 0.62; 'tags,': 0.81; 'joel': 0.91; 'url:templates': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=eWQIc1KtQFqsBkH+3U7mw/KLm8+IguMy5fWF2EMu7oc=; b=ajbGrYkf2VypKdn885LJRilIwoL9NzOBZzOFFRJa2nYyMwP/ZJQHijnZ2yuM4gfAnD r2E198KvgPNqHw8c0ASLqZ1S/78Z+YMZtiNJS8l0bj9z8JlFZcWkeRHoTL/bBiwXgVdS fvr4g2/0NvcwCWy2bBULvhwfaQR3qYcOfAqz8nx/pD9PK+cmwqoDQ4SYarWYfkk/uiiH jOAO/6HCL06svbQiiqhzaRQFmT4AuHFoXSuqlDuPAUyi3AWHlyeMAsENW0UzMNEwBzI8 vGotynCGi3L5J4I+iD3tyxhdMxG/1I7tPNZMhYcm/5mWttoRoJBQ7XCDUDIEokocYgUj /+zA==
MIME-Version 1.0
In-Reply-To <b198f16a-ff25-4a05-a680-d6adb07fdad9@googlegroups.com>
References <4d096ff3-e25f-400e-89c6-47483aaacc0d@googlegroups.com> <mailman.1791.1349350257.27098.python-list@python.org> <b198f16a-ff25-4a05-a680-d6adb07fdad9@googlegroups.com>
Date Thu, 4 Oct 2012 09:19:35 -0400
Subject Re: How to print html in python the normal way
From Joel Goldstick <joel.goldstick@gmail.com>
To Ramchandra Apte <maniandram01@gmail.com>
Content-Type text/plain; charset=UTF-8
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1795.1349356778.27098.python-list@python.org> (permalink)
Lines 30
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1349356778 news.xs4all.nl 6883 [2001:888:2000:d::a6]:50026
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:30723

Show key headers only | 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