A calendar is a system to organize time for administrative purposes.
Several pluggable calender apps already exists:
Though they have limited functionality and/or documentation.
Build a calender Application out of fullcalender.js, backbone and tastypie. Tastypie makes it easy to talk json to backbone and plotting the apointsments in fullcalendar is easy too. For recurring appointments use python's rrule.
Define a single appointment/event models and then create an instance of it with different dates an different slug for the range specified. Use rrule to calculate the date and the time for every date in the range [http://labix.org/python-dateutil#head-470fa22b2db72000d7abe698a5783a46b0731b57].
It can have an appointment model and an appointment series hich is linked to the appointment model.
It needs an appointment creation form, whihc can create a single appointment but the user shall also have the option to create recurring appointments, whihc will create series.
So, user is filling in the form and they are asked if this is a recurring appointment. If they select yes, it presents them with something the following:
There they can choose if the want the event to recur daily, weekly, monthly or yearly. Even better would be the possibility for any arbiturary interval.
if form.cleaned_data['is_recur'] == '1': # Find the interval first frequency_int = int(form.cleaned_data['frequency']) if freuqency_int == rrule.DAILY: interval = form.cleaned_data['daily_interval'] elif frequency_int == rrule.WEEKLY: interval = form.cleaned_data['weekly_interval'] elif frequency_int == rrule.MONTHLY['monthly_interval'] interval = form.cleaned_data['monthly_interval'] else: interval = form.cleaned_data['yearly_interval']
Then loop through all the dates created by rrule and create an appointment instance with a different date and the slug, which is the combination of appointment name and the date/time, e.g.
In appointment series store this info:
a_s = AppointmentSeries.objects.create( duty = duty, first_appointment = appt, frequency=form.cleaned_data['frequency'], is_date_or_number = form.cleaned_data['is_date_or_number'], recurrence_ned_date=None, interval=interval, )
You need to save the first appointment from which everything was created so that you can later refer to it when editing the series.
Check out the following information about fullcalender.js and backbone.js integration [http://blog.shinetech.com/2011/08/05/building-a-shared-calendar-with-backbone-js-and-fullcalendar-a-step-by-step-tutorial/].