forked from thauber/django-schedule
-
Notifications
You must be signed in to change notification settings - Fork 30
Rule configuration
bartekgorny edited this page Nov 27, 2010
·
2 revisions
Rules are objects which define reusable recurrence patterns. There are two attributes on a Rule:
- Frequency
- params
Frequency is simple - you will nearly always need simple daily, weekly or montly rules. Recurring event shows up every period the day/time it begins itself, so an event scheduled for Monday at 9:00am with weekly recurrency will duly show up every Monday morning.
Above that, params allow you to define any imaginable pattern.
Detailed description of every possible param can be found on Labix website. Here are some simple examples; see also test_rule.py.
- every Monday and Thursday
- WEEKLY
- byweekday:MO,TH
- every other day
- DAILY
- interval:2
- every other Monday
- WEEKLY
- byweekday:MO;interval:2
- first Friday of every month
- MONTHLY
- params':'byweekday:FR(1)
- every other month on the 1st and last Sunday of the month for 10 occurrences
- MONTHLY
- byweekday:SU(1), SU(-1);interval:2;count:10
(weekday codes are defined as: {"MO":0,"TU":1,"WE":2,"TH":3,"FR":4,"SA":5,"SU":6})