[Grok-dev] Time for a global_adapter?
optilude+lists at gmail.com
Sat Apr 4 05:07:13 EDT 2009
If I'm not missing something, it's not possible to do this without ZCML:
from z3c.form.widget import ComputedWidgetAttribute(
DefaultValueProvider = ComputedWidgetAttribute(
<adapter factory=".DefaultValueProvider" name="default" />
That is - I'm using a factory (ComputedWidgetAttribute in this case) to
obtain an adapter, which I then need to register under a name.
I could imagine something like:
to mimic grok.global_utility().
Do we need something like this?
As I've said before, I also think we should support named @adapter
although that's slightly different.
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book
More information about the Grok-dev