Can we allow multiple modules with shared templates directory without warning?

Bug #250977 reported by Lukas Zdych
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grok
Status tracked in 1.3
1.0
Won't Fix
High
Martijn Faassen
1.1
Fix Released
High
Martijn Faassen
1.3
Fix Released
High
Martijn Faassen

Bug Description

It would be usefull to allow shared template directory across multiple modules defining grok.View, grok.Viewlets etc. just like in zope3 alone for example:

sample
---/browser
---/---/templates
---/---/---/template1.pt
---/---/---/template2.pt
---/---/module1.py
---/---/module2.py

.. instead of force developer to create templates directory for each module even if for example module1 assignes 5 template files to itself and module2 only one..

Sure it can be done by using grok.templatedir('templates') directive in each module but that will procude warning for each module during zope instance start - which can lead to miss some other important warnings in a bunch of these warnings..

Thx for any response.

todd (todd-infrae)
Changed in grok:
assignee: nobody → brandon-rhodes
milestone: none → 1.0
Revision history for this message
Martijn Faassen (faassen) wrote :

We're currently considering a refactoring of Martian and Grok to make this possible. See also bug https://bugs.launchpad.net/bugs/255005 and https://bugs.launchpad.net/grok/+bug/309741

Revision history for this message
Wichert Akkerman (wichert) wrote :

I just noticed this as well. Even with a small number of modules using the same template directory you quickly get a large number of warnings about unused templates, drowning out possible real errors.

Revision history for this message
Wichert Akkerman (wichert) wrote :

As long as this refactoring has not happened, can we simply silence this warning? The number of warnings is getting out of hand now - with every new source file I add the number of warnings increases. I am looking at several pages of warnings for every Zope startup now :(

tags: added: europython2009
Revision history for this message
Vincent Fretin (vincent-fretin) wrote :

Godefroid Chapelle and me worked on this one.
We managed to fix it in shared_templates_userwarning branch in grokcore.view.

Revision history for this message
Reinout van Rees (reinout) wrote :

iirc, Martijn Faassen is refactoring this a bit. Martijn, what's the status?

Revision history for this message
Jan Wijbrand Kolman (janwijbrand) wrote :

This has clearly been done a while ago alreadym the issue just hasn't been updated... It is close now.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.