On 3/8/07, Gary Doades <[EMAIL PROTECTED]> wrote: > > I'm working on this very problem. > > The best way I have found so far is to use the rrule stuff from the > python-dateutil package. > > Given a repeat interval such as DAILY, WEEKLY, MONTHLY etc. it can > generate all the dates that your event occurs on between two dates. > > It will even generate for just "weekdays" or every other Monday etc. > etc. It also takes care of different sized months, leap years, etc. > > All you then need to do is store the parameters to the rrule in a table > and most of the work is done. > > To retrieve from the database all you need to do is find all the ones > that occur in your month of choice, feed all the rrules into an rruleset > and generate everything in one line by list'ing the rruleset. >
So in your Event model (or whatever you're calling it), you're essentially storing the keyword arguments to an rrule, depending on what's necessary for a particular event? Then whenever you need to render a calendar, you pull in all the Events from the db, create rrules for each using the stored parameters, and just work with the dateutil library to do the rest? Jay P. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---