TurboGears2 pluggable application for events and calendars
Project description
About calendarevents
calendarevents is a Pluggable calendars and events application for TurboGears2. It permits to create events which are associated to entities defined inside the application which plugs it in.
Calendarevents provides support for multiple calendars and event types, by defining new event types it is possible to define how the event relates to external entities like a blog post that describes it.
When displaying events if available weather informations for the day and location of the event will be provided.
Installing
calendarevents can be installed both from pypi or from bitbucket:
easy_install tgapp-calendarevents
should just work for most of the users
Plugging calendarevents
In your application config/app_cfg.py import plug:
from tgext.pluggable import plug
Then at the end of the file call plug with calendarevents:
plug(base_config, 'calendarevents', event_types=[...])
At least one event type must be defined inside the event_types argument. Defining event types is explained inside the Event Types section.
You will be able to access the calendars at http://localhost:8080/calendarevents.
Event Types
calendarevents needs the application to define at least one EventType to work.
Event types must be defined inheriting from the calendarevents.EventType class, for example to define an event for a concert which relates to a blog article that describes the concert itself:
class Concert(EventType): name = 'Concert' def get_linkable_entities(self, calendar): return [(a.uid, a.title) for a in model.DBSession.query(model.Article)] def get_linked_entity_info(self, event): return model.DBSession.query(model.Article).get(event.linked_entity_id).title def get_linked_entity_url(self, event): return tg.url('/blog/view/%s' % event.linked_entity_id) plug(base_config, 'calendarevents', event_types=[Concert()])
Event types can also specify some additional options to change the calendevents behavior. If the EventType specifies force_redirect = True as a class property whenever the event page is opened the user gets redirected to the linked entity url. EventType can also update the calendar informations be exposing a calendar_data(self, event) -> dict method that can return any additional information for the event (for example it can mark the event as allDay or not).
Exposed Partials
calendarevents exposes a partial to render event boxes inside other pages:
calendarevents.partials:event(event) - Renders an event box
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file tgapp-calendarevents-0.1.1.tar.gz
.
File metadata
- Download URL: tgapp-calendarevents-0.1.1.tar.gz
- Upload date:
- Size: 76.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9162c387e31eee5acf483b9edf731f7cc5eb6e06887c4ca935004ad591cdf4fb |
|
MD5 | 2246ff5cd07b33dc5bd86af6f0e083b6 |
|
BLAKE2b-256 | 9c03271f73febb5d08ba0fa8c45ece527058f3aee1cbb68972dc9561a9634f9e |