I've thought of doing this too but it doesn't look easy.  You'll need
to dig deep into django in order to extract out the part that
recursively loads template objects (as templates may extend from other
templates recursively).

Look in your google app engine install directory ... google/appengine/
ext/webapp/template.py for the code that is currently bootstrapping
django and loading up your templates in the proper file path context.

Stephen

On Sep 15, 6:26 pm, PatHaugen <[email protected]> wrote:
> I tried your example a few different ways, still get an error:
> AttributeError: 'str' object has no attribute 'render'
>
> bar = # pulled template from DB
> self.response.out.write(bar.render(template.Context(template_values)))
>
> Tried again using what you did on 'bar' before:
>
> foo = # pulled template from DB
> bar = template.Template(foo)
> self.response.out.write(bar.render(template.Context(template_values)))
>
> Not sure if 'template.Template()' takes a str and makes it into a
> 'template' able to be rendered, does this code work on your side?
>
> I even tried scrapping the way I pull the template and using your
> method:
> foo = db.get(templatekey).templatetext
>
> Before that, I had to do another DB query to pull the key value of the
> template I wanted, regardless it still failed...
>
> On Sep 15, 11:09 am, Wooble <[email protected]> wrote:
>
> > On Sep 15, 2:08 pm, Wooble <[email protected]> wrote:
>
> > > self.response.out.write(bar.render(template_values))
>
> > correction: you'll need to wrap template_values in template.Context();
> > template.render() does this for you automagically.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to