On May 28, 12:52 pm, Itamar O <[email protected]> wrote:
> Hi,
> In ITemplateStreamFilter#filter_stream, I need to know the realm and id of
> the resource being processed.
> How do I obtain this information?

The stream filter works for any output, so it may not necessarily be a
single known resource being rendered. You can try a careful lookup of
the data dict to find the context, and if found it should have a
resource attached. Something like:

resource = data.get('context') and data['context'].resource or None

This can of course be tweaked if you already perform conditional
checks like for template name or similar that already refine the
possible data you may see.


:::simon

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en.

Reply via email to