Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to print html in python the normal way
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
ashishjain....@gmail.com  
View profile  
 More options Oct 4 2012, 7:24 am
Newsgroups: comp.lang.python
From: ashishjain....@gmail.com
Date: Thu, 4 Oct 2012 04:24:13 -0700 (PDT)
Local: Thurs, Oct 4 2012 7:24 am
Subject: How to print html in python the normal way
Hi,

I wrote a simple filter as:

@register.filter()
def html(value):
    return '<p>Check</p>'

when I use this filter in my template, it displays html as:

<p>Check</p>

I want to display as:

Check

am I missing something.

- Thanks for your help
Ashish


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Angelico  
View profile  
 More options Oct 4 2012, 7:30 am
Newsgroups: comp.lang.python
From: Chris Angelico <ros...@gmail.com>
Date: Thu, 4 Oct 2012 21:30:53 +1000
Local: Thurs, Oct 4 2012 7:30 am
Subject: Re: How to print html in python the normal way

On Thu, Oct 4, 2012 at 9:24 PM,  <ashishjain....@gmail.com> wrote:
> am I missing something.

The first thing you're missing is more detail in your question. My
crystal ball tells me you're using some kind of web framework and
viewing this in your browser. And my second crystal ball suggests that
it's probably Django. But is this correct? Lots more detail, please!

ChrisA


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ramchandra Apte  
View profile  
 More options Oct 4 2012, 9:11 am
Newsgroups: comp.lang.python
From: Ramchandra Apte <maniandra...@gmail.com>
Date: Thu, 4 Oct 2012 06:11:56 -0700 (PDT)
Local: Thurs, Oct 4 2012 9:11 am
Subject: Re: How to print html in python the normal way

+1

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ramchandra Apte  
View profile  
 More options Oct 4 2012, 9:12 am
Newsgroups: comp.lang.python
From: Ramchandra Apte <maniandra...@gmail.com>
Date: Thu, 4 Oct 2012 06:11:56 -0700 (PDT)
Local: Thurs, Oct 4 2012 9:11 am
Subject: Re: How to print html in python the normal way

+1

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joel Goldstick  
View profile  
 More options Oct 4 2012, 9:19 am
Newsgroups: comp.lang.python
From: Joel Goldstick <joel.goldst...@gmail.com>
Date: Thu, 4 Oct 2012 09:19:35 -0400
Local: Thurs, Oct 4 2012 9:19 am
Subject: Re: How to print html in python the normal way
On Thu, Oct 4, 2012 at 9:11 AM, Ramchandra Apte <maniandra...@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....@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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ashishjain....@gmail.com  
View profile  
 More options Oct 5 2012, 4:20 am
Newsgroups: comp.lang.python
From: ashishjain....@gmail.com
Date: Fri, 5 Oct 2012 01:20:28 -0700 (PDT)
Local: Fri, Oct 5 2012 4:20 am
Subject: Re: How to print html in python the normal way
Hi,

Thanks for the reply.
Apologies for my question not clear. Yes I am using django framework for it.

- Regards
Ashish


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ashishjain....@gmail.com  
View profile  
 More options Oct 5 2012, 4:21 am
Newsgroups: comp.lang.python
From: ashishjain....@gmail.com
Date: Fri, 5 Oct 2012 01:20:28 -0700 (PDT)
Local: Fri, Oct 5 2012 4:20 am
Subject: Re: How to print html in python the normal way
Hi,

Thanks for the reply.
Apologies for my question not clear. Yes I am using django framework for it.

- Regards
Ashish


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »