Trees Indices Help
Trac
Package trac :: Package timeline :: Module api :: Class ITimelineEventProvider

Class ITimelineEventProvider

source code

 object --+ 
 | 
core.Interface --+
 |
 ITimelineEventProvider

Extension point interface for adding sources for timed events to the timeline.
Instance Methods
get_timeline_filters(req)
Return a list of filters that this event provider supports. source code
get_timeline_events(req, start, stop, filters)
Return a list of events in the time range given by the start and stop parameters. source code
render_timeline_event(context, field, event)
Display the title of the event in the given context. source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

get_timeline_filters(req)

source code

Return a list of filters that this event provider supports.

Each filter must be a (name, label) tuple, where name is the internal name, and label is a human-readable name for display.

Optionally, the tuple can contain a third element, checked. If checked is omitted or True, the filter is active by default, otherwise it will be inactive.

get_timeline_events(req, start, stop, filters)

source code

Return a list of events in the time range given by the start and stop parameters.

The filters parameters is a list of the enabled filters, each item being the name of the tuples returned by get_timeline_filters.

Since 0.11, the events are (kind, date, author, data) tuples, where kind is a string used for categorizing the event, date is a datetime object, author is a string and data is some private data that the component will reuse when rendering the event.

When the event has been created indirectly by another module, like this happens when calling AttachmentModule.get_timeline_events() the tuple can also specify explicitly the provider by returning tuples of the following form: (kind, date, author, data, provider).

Before version 0.11, the events returned by this function used to be tuples of the form (kind, href, title, date, author, markup). This is still supported but less flexible, as href, title and markup are not context dependent.

render_timeline_event(context, field, event)

source code
Display the title of the event in the given context.
Parameters:
  • context - the rendering Context object that can be used for rendering
  • field - what specific part information from the event should be rendered: can be the 'title', the 'description' or the 'url'
  • event - the event tuple, as returned by get_timeline_events

Trees Indices Help
Trac

AltStyle によって変換されたページ (->オリジナル) /