[Zope3-dev] Re: Mini proposal: simpify presentation-lookup api
Jim Fulton
jim at zope.com
Thu Apr 1 11:21:00 EST 2004
Philipp von Weitershausen wrote:
> Jim Fulton wrote:
>
...
> In the docstrings, you talk about presentations, but the methods are
> called {get|query}Presenter. I think they should be called
> {get|query}Presentation. That's also inline with the service being
> called Presentation Service, the service for Adapters being called
> Adapter Service, etc. etc.
Presenter is shorter. I'm open to even shorter names. :)
We can rename the service.
> That's good, since I guess we'll have BrowserViews etc. provide
> IPublished...
Well, "pages" will present IPublished. I'm working on a separate
proposal for that. :)
>> So, for example, a call like:
>>
>> view = zapi.getView(ob, name, request)
>>
>> will become:
>>
>> view = zapi.getPresenter((ob, request), someinterface, name)
>
>
> How will resources be looked up?
resource = zapi.getPresenter((request, ), someinterface, name)
>> where often, name will be '' and can be ommitted:
>
>
> Btw, why does name default to ''. I find that a little implicit. I would
> much rather have it default to None.
No, because None is not a valid name. :)
I've trid it both ways. It's simpler in the long run to simply say that
unnamed things are things with empty names.
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the Zope3-dev
mailing list