[Grok-dev] Re: Getting the application in views and viewlets

Martijn Faassen faassen at startifact.com
Fri Jun 20 12:12:42 EDT 2008


Hey,

Sebastian Ware wrote:
> 19 jun 2008 kl. 19.41 skrev Martijn Faassen:
>> Leonardo Rochael Almeida wrote:
>> [snip]
>>>> Graham, patches are welcome. I think the getSite() approach might be 
>>>> the
>>>> best approach right now.
>>> Or maybe a fallback approach? Register the application as a local
>>> utility and if that doesn't work, log a deprecation warning and look
>>> it up through getSite() and __parent__.
>>
>> Not a bad idea. One question is when we'd ever be free to remove the 
>> fallback then. We'd still need to solve the upgrade problem.
> 
> Isn't this the same type of upgrade problem one has when adding indexes 
> to an existing application. If it is, finding a nice and simple solution 
> for these kind of upgrades would be a very big improvement.

Well, it's content upgrades in general, and yes, it would be possible to 
build a nicer solution that what's available right now with 
zope.generations. It's just it needs some time investment of a few 
people to design it and implement it. It'd make a good sprint topic too.

What about going with idea 2 first (getSite() and a fallback with 
__parent__), and then people investigate idea 3 for a future release 
(once upgrade issues are worked out?)? Patches are welcome, idea 2 
should be easy enough to implement. It should be called 
grok.getApplication(), the view.application_url should make use of it, 
and there should be some (probably functional) tests.

Regards,

Martijn



More information about the Grok-dev mailing list