[Grok-dev] grokcore.view and the application_url/flash tandem
Souheil CHELFOUH
trollfot at gmail.com
Thu Mar 4 04:08:11 EST 2010
Hello grokkers,
Now, the flash method can be added to grokcore.view thanks to grokcore.message.
We still have the rogue "application_url" that forces us to depend on
Grok, since grokcore.view.View doesn't provide the same methods than
grok.View.
I'd like to propose the following :
1. Add an application_url method to the grokcore.view.View class,
using a simple getSite hook call. This is what we, most of the time,
need.
2. Keep the current application_url implementation in Grok.
3. Move the grok View interface with application_url and flash to grokcore.view
The application_url in grokcore.view would look like :
def application_url(self, name=None):
"""Return the URL of the nearest site.
"""
site = getSite()
if site is None:
raise zope.component.ComponentLookupError("No site found.")
return self.url(site, name)
Insights ?
- Souheil
More information about the Grok-dev
mailing list