[Grok-dev] Is there a before publish event?

Jan-Wijbrand Kolman janwijbrand at gmail.com
Tue Jun 15 05:08:22 EDT 2010

> IBeforeTraverseEvent is called before traversing
> each part of a request so it isn't very good for
> forcing things like layers if it requires some
> computing. Is there an event fired once prior
> to the publishing process (ie first thing when
> the request arrives)?

Are you aware of the fact you can subscribe to an IBeforeTraverseEvent 
for a specific type of objects, right?

I mean, we do apply a skin onto the request using a subscriber like so:

  @grok.subscribe(IMyTypeOfAppObject, IBeforeTraverseEvent)
  def apply_applicationskin(app, event):
    skin = skin_selection_computation()
    applySkin(event.request, skin)

This subscriber is now only called for the traverse step over the app 
object in the path. Is that what you were aiming for?

regards, jw

More information about the Grok-dev mailing list