Re: Reading an entire template into a string

2008-04-14 Thread nandu



On Apr 15, 8:16 am, nandu <[EMAIL PROTECTED]> wrote:
> On Apr 14, 8:42 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
>
> > Not render, just load.
>
> > I think `django.template.loader.find_template_source` can help
>
> > On Apr 14, 4:17 pm, Darryl Ross <[EMAIL PROTECTED]> wrote:
>
> Thank you for your reply.
>
> I tried using django.template.loader.find_template_source` becuase I
> am reading in an HTML template the newlines (\n)
> do not get rendered in the browser.  Is there any way to strip out the
> newlines from the return value of
> `django.template.loader.find_template_source`
>
> Thanks,
> Nandu

Sorry django.template.loader.find_template_source does work.  It
returns a tuple a number of values in my case just two.  The first one
contains the template string itself and does not contain any newline
characters.
Hence, if I reference the first value of the tuple I will ge what I
need.

Thanks to all who have posted
Nandu
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Reading an entire template into a string

2008-04-14 Thread nandu



On Apr 14, 8:42 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
> Not render, just load.
>
> I think `django.template.loader.find_template_source` can help
>
> On Apr 14, 4:17 pm, Darryl Ross <[EMAIL PROTECTED]> wrote:

Thank you for your reply.

I tried using django.template.loader.find_template_source` becuase I
am reading in an HTML template the newlines (\n)
do not get rendered in the browser.  Is there any way to strip out the
newlines from the return value of
`django.template.loader.find_template_source`

Thanks,
Nandu
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Reading an entire template into a string

2008-04-14 Thread Alex Koshelev

Not render, just load.

I think `django.template.loader.find_template_source` can help

On Apr 14, 4:17 pm, Darryl Ross <[EMAIL PROTECTED]> wrote:
> nandu wrote:
> > Dear Folks,
>
> > I wish to read an entire template into a string or at least use a
> > method in django.template that will output the template as a string.
> > Note I am not trying to render the template I am just trying to save
> > it in a string.
>
> > I hope you can help me in this request or at least point me in the
> > right direction.
>
> http://www.google.com.au/search?q=django+render_to_string
>
> --
>
> Darryl Ross
> Director
> AFOYI, "Information Technology Solutions"
> p 08 7127 1831
> m 0400 206 443
> f 08 8425 9607
> e [EMAIL PROTECTED]
>
>  signature.asc
> 1KDownload
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Reading an entire template into a string

2008-04-14 Thread Darryl Ross

nandu wrote:

Dear Folks,

I wish to read an entire template into a string or at least use a
method in django.template that will output the template as a string.
Note I am not trying to render the template I am just trying to save
it in a string.

I hope you can help me in this request or at least point me in the
right direction.


http://www.google.com.au/search?q=django+render_to_string


--

Darryl Ross
Director
AFOYI, "Information Technology Solutions"
p 08 7127 1831
m 0400 206 443
f 08 8425 9607
e [EMAIL PROTECTED]




signature.asc
Description: OpenPGP digital signature


Reading an entire template into a string

2008-04-14 Thread nandu

Dear Folks,

I wish to read an entire template into a string or at least use a
method in django.template that will output the template as a string.
Note I am not trying to render the template I am just trying to save
it in a string.

I hope you can help me in this request or at least point me in the
right direction.

Thank you.

Yours sincerely,
Nandu
14 Apr 08
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---