Skip to main content

A Django calendaring application.

Project description

https://pypip.in/v/django-swingtime/badge.svg https://pypip.in/d/django-swingtime/badge.svg https://travis-ci.org/dakrauth/django-swingtime.svg?branch=master https://badge.fury.io/py/django-swingtime.svg https://pypip.in/license/django-swingtime/badge.svg

Welcome

Swingtime is a Django application similar to a stripped-down version of iCal for Mac OS X or Google Calendar. Swingtime provides a models.Event model that acts as metadata container for one or more models.Occurrence objects, which describe specific start and end times.

Swingtime relies heavily upon both the datetime standard library package and the dateutil package, featuring direct support for the dateutil.rrule interface to create occurrences.

A fairly simple example:

>>> from datetime import *
>>> from swingtime import models as swingtime
>>> et = swingtime.EventType.objects.create(abbr='work', label='Work Related Events')
>>> evt = swingtime.Event.objects.create(
...     title='New TPS Cover Sheet',
...     description='Kiss off, Lumbergh!',
...     event_type=et
... )
>>> evt.add_occurrences(datetime(2013,4,1,16), datetime(2013,4,1,16,15), count=5)
>>> for o in evt.occurrence_set.all():
...     print o
...
New TPS Cover Sheet: 2013-04-01T16:00:00
New TPS Cover Sheet: 2013-04-02T16:00:00
New TPS Cover Sheet: 2013-04-03T16:00:00
New TPS Cover Sheet: 2013-04-04T16:00:00
New TPS Cover Sheet: 2013-04-05T16:00:00

A bit more elaborate example, using the the convenience function models.create_event:

>>> # pay day is the last Friday of the month at 5pm
>>> evt = swingtime.create_event(
...     'Pay day',
...     ('pay', 'Payroll'), # alternate means to add EventType on the fly
...     freq=rrule.MONTHLY,
...     byweekday=rrule.FR(-1),
...     until=datetime(2013,8,1),
...     start_time=datetime(2013,4,1,17)
... )
>>> for o in evt.occurrence_set.all():
...     print o
...
Pay day: 2013-04-26T17:00:00
Pay day: 2013-05-31T17:00:00
Pay day: 2013-06-28T17:00:00
Pay day: 2013-07-26T17:00:00

Features

  • Support for adding complex event occurrences via dateutil

  • Ready-made forms.MultipleOccurrenceForm for handling complex input

  • Daily, monthly, and annual view functions

  • Grid-based daily view generator, complete with alternating or sequential EventType CSS-class handling

  • Slightly better than average documentation, a few test cases, and commented code

  • Active support (I have to eat my own dogfood)

  • Built-in demo project / application

Requirements

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-swingtime-0.5.tar.gz (31.2 kB view details)

Uploaded Source

File details

Details for the file django-swingtime-0.5.tar.gz.

File metadata

File hashes

Hashes for django-swingtime-0.5.tar.gz
Algorithm Hash digest
SHA256 47263c30477f941ceaefe90c231fc331943678e2f9a988fe9bc487cafefedc64
MD5 6a828aa6fbbfd9a2d258be37662935f7
BLAKE2b-256 96cd333d86d8d5f782cd0fdf1f46fcbece80c805b8aa1c24b311034bc4fed587

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page