[Zope3-Users] views based on request method (GET, POST, etc.)

Jan-Wijbrand Kolman jan-wijbrand.kolman at inghist.nl
Wed Sep 13 04:42:50 EDT 2006


Stephan Richter wrote:
> On Tuesday 12 September 2006 07:38, Jan-Wijbrand Kolman wrote:
>> But I have the feeling this can be done more elegantly. I did notice
>> something in this direction in zope/app/dav/configure.zcml, but I'm not
>> sure this actually helps. It could be I overlook something very very
>> obvious...
> 
> you have two choices:
> 
> 1. Implement HTTP verbs as methods. See the resources implementation. 
> zope.app.publisher.browser
> 
> 2. Register some view having the method name as the view name. See 
> SchoolTool's REST implementation, for example, schooltool.person.rest.

Hi Stephan!


The first option would work just fine for me indeed.

Out of curiosity though, I wonder about the second option:

I *think* to understand that for this option to work, 
z.a.publication.http.HTTPublication must be used for handling requests 
(instead of z.a.publication.browser.BrowserRequest), right?

And what publication implementation is used when, is in principle 
configured in zope/app/publication/configure.zcml, right?

But then I loose track of how things are tied together... How can I make 
sure this HTTPublication is used for one or more of the content types in 
my application? Maybe (probably) Schooltool does things different in 
this regard than 'stock' Zope-3?

But its quite possible that I'm asking stupid questions now, because I'm 
not sure I can see the forest through the trees anymore ;)

Anyway, thanks for your help!


regards,
jw

-- 
Jan-Wijbrand Kolman
software ontwikkelaar, Instituut voor Nederlands Geschiedenis
jan-wijbrand.kolman at inghist.nl


More information about the Zope3-users mailing list