eg:
/index
r = template.render('templates/', cache=False)
/view
r = template.render('templates/default/', cache=False)
when you visit the /vew, and then visit /index, you will get an error
me too :)
On Sun, Mar 9, 2008 at 2:48 AM, Hermann Kaser <[EMAIL PROTECTED]>
wrote:
> Hello all,
>
> After I solved that odd caching issue I was having (thanks Graham!) I
> started getting a different issue. Scenario is as follows: I visit a
> page on my site and I get the error. I refresh a couple times and the
> error disappears, I can then browse the website without a problem, but
> if I leave and come back a few hours later the problem appears again
> the cycle restarts (refresh a couple times..., etc.).
>
> The problem is that render has problems finding the template I want.
> Because I need to dynamically require templates I use the getattr
> function for this end. The following code is an almost exact example
> of what I'm doing:
>
> name = 'index'
> r = template.render('templates/', cache=False)
> skin = getattr(r, 'main')
> body = getattr(r, name)
>
> And it brings up the following exception on the last line:
>
> AttributeError: no template named index
>
> Note that it succesfully finds the first template, but fails on the
> second one. Also note that refreshing a couple times solves the issue.
>
> Anyone know what might be going on or how to avoid this issue? Even if
> the solution is a more verbose way of including templates dynamically
> I'd be happy.
>
> Regards,
> Hermann Käser
> http://theragingche.com/
> http://semicir.cl/user/hermzz
>
> >
>
--
http://del.icio.us/iexper
http://twitter.com/qichangxing
http://webpy.org
http://blog.hi0791.com (build with web.py)
http://www.baicai.com 百才招聘
Gtalk: iexper(at)gmail.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---