[Grok-dev] Re: View URLs?

Martijn Faassen faassen at startifact.com
Wed Jun 25 10:03:20 EDT 2008

Peter Bengtsson wrote:
> 2008/6/25 Sebastian Ware <sebastian at urbantalk.se>:
>> And if you want to get the url to your application root from another
>> object's view you can do
>>   view.url(grok.getSite())
> How is this different from view.application_url()?

Good question.

All applications are sites. Not all sites are applications. A site is 
something in Zope 3 that can hold local components; typically local 
utilities. So if you say getSite(), it'll give you the site closest to 
you in traversal space. view.application_url however digs up the actual 
application object.

This is why we need a grok.getApplication() which actually gets the 
site. I proposed an implementation strategy a while ago, and someone 
should just write the code, some functional tests (which should include 
an actual site object as well to make sure the application is found, not 
the site). With a bit more documentation we can then have less of this 



More information about the Grok-dev mailing list