[Grok-dev] grok.LocalUtility and grok.site()

Jan-Wijbrand Kolman janwijbrand at gmail.com
Wed Feb 23 08:13:33 EST 2011


Hi,

To register a local utility in a site object you do something like this:

class MyThing(grok.LocalUtility):
   grok.name('mything')
   grok.implements(IThing)

class SomeSite(grok.Site):
   grok.local_utility(MyThing)


Now I wonder, why didn't we implement this spelling as well:

class MyThing(grok.LocalUtility):
   grok.name('mything')
   grok.implements(IThing)
   grok.site(SomeSite) # <-- register this utility in SomeSite instances


I vaguely remember there's reason for not having the second spelling, 
but I can't recall anymore what it was. Does anyone know?

regards, jw



More information about the Grok-dev mailing list