strange path limitation for templatedir directive
Bug #562262 reported by
Wichert Akkerman
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
grok | Status tracked in 1.3 | |||||
1.3 |
In Progress
|
Undecided
|
Unassigned |
Bug Description
I want to organize my templates by type, but all in a single templates subdirectory. That means the paths to the templates relative to the python source look like templates/
I can not think of a good reason for that restriction. It does not help with security since the person writing that directive can already write python code to do anything. Can that test be removed?
To post a comment you must log in.
I am not sure if this is related or warrants a separate bug: the grok.template directive does allow a path separator in its parameter, but the result is a somewhat nasty error on zope startup:
File "/Users/ wichert/ Library/ eggs/zope. configuration- 3.6.0-py2. 6.egg/zope/ configuration/ xmlconfig. py", line 649, in file execute_ actions( ) wichert/ Library/ eggs/zope. configuration- 3.6.0-py2. 6.egg/zope/ configuration/ config. py", line 605, in execute_actions wichert/ Library/ eggs/grokcore. view-1. 12.2-py2. 6.egg/grokcore/ view/meta/ views.py" , line 90, in checkTemplates wichert/ Library/ eggs/grokcore. view-1. 12.2-py2. 6.egg/grokcore/ view/templatere g.py", line 135, in checkTemplates name.title( ), factory), factory) ecutionError: <class 'martian. error.GrokError '>: View <class 'plonetheme. nuplone. skin.error. Error'> has no associated template or 'render' method. wichert/ Work/syslab/ euphorie/ buildout/ trunk/src/ NuPlone/ plonetheme/ nuplone/ configure. zcml", line 22.2-22.27
context.
File "/Users/
callable(*args, **kw)
File "/Users/
has_render, has_no_render)
File "/Users/
(component_
ConfigurationEx
in:
File "/Users/
<grok:grok package="." />
> /Users/ wichert/ Library/ eggs/grokcore. view-1. 12.2-py2. 6.egg/grokcore/ view/templatere g.py(135) checkTemplates( ) name.title( ), factory), factory)
-> (component_
the relevant source is correct:
log=logging. getLogger( __name_ _)
grok.templatedi r("templates" )
class Error(grok.View): context( Exception) layer(NuPloneSk in) name("index. html") template( "errors/ generic" )
grok.
grok.
grok.
grok.
def update(self):
self.exception =aq_inner( self.context)
self.context= aq_parent( self)
log.exception( "Error at %r", self.context)