<div dir="ltr">I think Andreas was more referring to the pyramid way of doing various view discriminators.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jan 4, 2014 at 11:44 AM, Asko Soukka <span dir="ltr"><<a href="mailto:asko.soukka@iki.fi" target="_blank">asko.soukka@iki.fi</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
ajung wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Having a similar functionality like<br></div>
@view_request in Pyramid would be cool...<br>
</blockquote>
<br>
I had an hour in train to try this out. I hope, I understood this correctly.<br>
<br>
I tried out a zope.configuration directive with venusian decorator like<br>
<br>
<br>
@view_configure(name='hello_<u></u>world', for_='*',<br>
                permission='zope2.View')<br>
def hello_world(context, request):<br>
    return u"Hello World!"<br>
<br>
<br>
which would render the returned result, or<br>
<br>
<br>
@view_configure(name='hello_<u></u>world', for_='*',<br>
                template='templates/<a href="http://hello_world.pt" target="_blank">hello_<u></u>world.pt</a>',<br>
                permission='zope2.View')<br>
def hello_world(context, request):<br>
     return {'content': u"Hello World!"}<br>
<br>
<br>
which would render <a href="http://hello_world.pt" target="_blank">hello_world.pt</a> with u"Hello World!" available at view/content.<br>
<br>
Technically, my directive creates a dynamic BrowserView-based class, with decorated function as static method, to be called in __call__. Quite ok, but the "dynamic class" might be a problem when debugging errors. However, this approach allowed me to re-use existing directives and I needed only a few new lines of code for this feature.<br>

<br>
So, I don't think that zope.configuration is our problem.<br>
<br>
We could have @view_configure for Plone if we'd like to (or maybe @page_configure to avoid mixing it with Pyramid's view_configure or Zope 3's "Views", which are different from BrowserPages). But, of course, this would not solve our current issue of having already too many ways to define Views and easy-to-find documentation for any of them. (Luckily, there's documentation sprints coming up this year \o/).<span class="HOEnZb"><font color="#888888"><br>

<br>
-Asko</font></span><div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<br>
Product-Developers mailing list<br>
<a href="mailto:Product-Developers@lists.plone.org" target="_blank">Product-Developers@lists.<u></u>plone.org</a><br>
<a href="https://lists.plone.org/mailman/listinfo/plone-product-developers" target="_blank">https://lists.plone.org/<u></u>mailman/listinfo/plone-<u></u>product-developers</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Nathan Van Gheem<div>Solutions Architect</div><div>Wildcard Corp</div></div>
</div>