[Grok-dev] overriding Grokkers
Brandon Craig Rhodes
brandon at rhodesmill.org
Tue Oct 16 09:49:34 EDT 2007
Martijn Faassen <faassen at startifact.com> writes:
> * we have a grokker defined for some class inside Grok
> * we want to define a subclass for this class
> * we want there to be a grokker for this subclass
> * we *don't* want the grokker for the base class to do any work
> * is this a valid use case at all?
I ran into it the other day when starting my megrok.trails product.
If you check inside of its code, you will see it create a subclass of
(I believe) "grok.Traverser", and it has to have a grok.content()
declaration into which I throw a dummy class, to prevent Grok from
choking on the fact that it thinks my class is a real Traverser.
I'll comment further when my morning presentation is over; in the
meantime, consult my code for details.
Brandon Craig Rhodes brandon at rhodesmill.org http://rhodesmill.org/brandon
More information about the Grok-dev