[Grok-dev] Re: The old request object, where do I look?

Martijn Faassen faassen at startifact.com
Mon Aug 13 10:03:21 EDT 2007


Hey,

Sebastian Ware wrote:

> During a request, which useful objects are available? I am having 
> difficulties finding where to look. What I would like to know is:

What are you looking for?

> -What members does self.request have?

request.form tends to contain useful information.

> -What is available in self.request.principal? (I want to access user 
> credentials)

The principal is object representing the user. What do you mean by 
accessing user credentials?

> -Any other useful objects?
> 
> I have looked in the interface 
> zope.publisher.interfaces.http.IHTTPRequest, but not found much 
> information. 

Typically you deal with a derived interface from that, IBrowserRequest:

zope.publisher.interfaces.browser.IBrowserRequest

This one defines 'form'

This also derives from IHTTPApplicationRequest:

zope.publisher.interfaces.http.IHTTPApplicationRequest

This one defines 'cookies', 'headers', 'URL', and a whole bunch of methods.

All this also derives from 
zope.publisher.interfaces.IApplicationRequest, which defines more stuff.

It's all very much factored, which indeed makes it harder to find stuff 
in one place. Our admin interface should eventually help, and so should 
a grok reference.

Regards,

Martijn



More information about the Grok-dev mailing list