Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #30716 > unrolled thread
| Started by | ashishjain.ash@gmail.com |
|---|---|
| First post | 2012-10-04 04:24 -0700 |
| Last post | 2012-10-05 01:20 -0700 |
| Articles | 7 — 4 participants |
Back to article view | Back to comp.lang.python
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
| From | ashishjain.ash@gmail.com |
|---|---|
| Date | 2012-10-04 04:24 -0700 |
| Subject | How to print html in python the normal way |
| Message-ID | <4d096ff3-e25f-400e-89c6-47483aaacc0d@googlegroups.com> |
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
[toc] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2012-10-04 21:30 +1000 |
| Message-ID | <mailman.1791.1349350257.27098.python-list@python.org> |
| In reply to | #30716 |
On Thu, Oct 4, 2012 at 9:24 PM, <ashishjain.ash@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
[toc] | [prev] | [next] | [standalone]
| From | Ramchandra Apte <maniandram01@gmail.com> |
|---|---|
| Date | 2012-10-04 06:11 -0700 |
| Message-ID | <b198f16a-ff25-4a05-a680-d6adb07fdad9@googlegroups.com> |
| In reply to | #30717 |
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. > > > > 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 +1
[toc] | [prev] | [next] | [standalone]
| From | Joel Goldstick <joel.goldstick@gmail.com> |
|---|---|
| Date | 2012-10-04 09:19 -0400 |
| Message-ID | <mailman.1795.1349356778.27098.python-list@python.org> |
| In reply to | #30720 |
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
[toc] | [prev] | [next] | [standalone]
| From | Ramchandra Apte <maniandram01@gmail.com> |
|---|---|
| Date | 2012-10-04 06:11 -0700 |
| Message-ID | <mailman.1794.1349356325.27098.python-list@python.org> |
| In reply to | #30717 |
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. > > > > 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 +1
[toc] | [prev] | [next] | [standalone]
| From | ashishjain.ash@gmail.com |
|---|---|
| Date | 2012-10-05 01:20 -0700 |
| Message-ID | <744677a5-8f47-4b03-b15f-2b3db6f0642d@googlegroups.com> |
| In reply to | #30717 |
Hi, Thanks for the reply. Apologies for my question not clear. Yes I am using django framework for it. - Regards Ashish
[toc] | [prev] | [next] | [standalone]
| From | ashishjain.ash@gmail.com |
|---|---|
| Date | 2012-10-05 01:20 -0700 |
| Message-ID | <mailman.1844.1349425232.27098.python-list@python.org> |
| In reply to | #30717 |
Hi, Thanks for the reply. Apologies for my question not clear. Yes I am using django framework for it. - Regards Ashish
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web