[Grok-dev] Is there a before publish event?
Sebastian Ware
sebastian at urbantalk.se
Tue Jun 15 05:24:03 EDT 2010
Yes, but I didn't think of that simple and obvious solution! Problem solved!
Mvh Sebastian
15 jun 2010 kl. 11.08 skrev Jan-Wijbrand Kolman:
>> 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
>
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> https://mail.zope.org/mailman/listinfo/grok-dev
More information about the Grok-dev
mailing list