Re: Marking a DateField event as "repeating"

2007-03-08 Thread Gary Doades
Yeah, I'd actually considered that. We do use that method on another product. The big upside is that you don't have to store exceptions if you remove just one date in the future from the recurrence pattern, you just remove that one date record from the database. There can be a big downside de

Re: Marking a DateField event as "repeating"

2007-03-08 Thread Jeremy Dunck
On 3/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: ... > Also I store these Schedules as a top level table. I then create > Resources (Events?) that "use" a specific schedule. This way I can > have lots of Resources that use the same Schedule, again minimising > the number of schedule records

Re: Marking a DateField event as "repeating"

2007-03-08 Thread Jay Parlar
On 3/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Sorry, the date_from and date_to are probably superfluous for your > needs. For my system they represent the period that this schedule is > valid for and therefore the absolute extent that rrule can generate > dates for. > > For my applicat

Re: Marking a DateField event as "repeating"

2007-03-08 Thread [EMAIL PROTECTED]
On Mar 8, 4:31 pm, "Jay Parlar" <[EMAIL PROTECTED]> wrote: > Mostly I'm cool with that, but one thing just isn't clicking yet: Your > date_from and date_to fields, I'm guessing these represent the from/to > dates of the *original* event, and aren't affected by repetitions? So > if that's the ca

Re: Marking a DateField event as "repeating"

2007-03-08 Thread Jay Parlar
On 3/8/07, Gary Doades <[EMAIL PROTECTED]> wrote: > > > > > 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 p

Re: Marking a DateField event as "repeating"

2007-03-08 Thread Gary Doades
> > 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 usin

Re: Marking a DateField event as "repeating"

2007-03-08 Thread Jay Parlar
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

Re: Marking a DateField event as "repeating"

2007-03-07 Thread Gary Doades
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

Re: Marking a DateField event as "repeating"

2007-03-07 Thread Malcolm Tredinnick
On Wed, 2007-03-07 at 23:09 -0500, Jay Parlar wrote: > On 3/7/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > Sorry, I skipped the first step in the reasoning because I thought it > > was obvious. My bad. > > > > Except for events that repeat only yearly, every single one of your > > events

Re: Marking a DateField event as "repeating"

2007-03-07 Thread Jay Parlar
On 3/7/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Sorry, I skipped the first step in the reasoning because I thought it > was obvious. My bad. > > Except for events that repeat only yearly, every single one of your > events is going to occur at least once in any given month. The only > ex

Re: Marking a DateField event as "repeating"

2007-03-07 Thread Malcolm Tredinnick
On Wed, 2007-03-07 at 22:45 -0500, Jay Parlar wrote: [...] > I'm not quite understanding part of your first paragraph though: "I > would create a method on the model that takes a date (what you are > really interested in is the month and year) and returns a list of the > dates in that month when t

Re: Marking a DateField event as "repeating"

2007-03-07 Thread Jay Parlar
On 3/7/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > This shouldn't be too hard to do (it was a fun problem to think about > over lunch). I would create a method on the model that takes a date > (what you are really interested in is the month and year) and returns a > list of the dates in th

Re: Marking a DateField event as "repeating"

2007-03-07 Thread Malcolm Tredinnick
On Wed, 2007-03-07 at 20:33 -0500, Jay Parlar wrote: > So I'm working on a calendar application, and trying to come up with > an efficient way to mark some event as repeating. > > The trivial way to create the model would be something like: > > REPEAT = ( > ('D', 'Daily'), > ('W', 'Weekl

Re: Marking a DateField event as "repeating"

2007-03-07 Thread Rubic
On Mar 7, 7:33 pm, "Jay Parlar" <[EMAIL PROTECTED]> wrote: > When I render a calendar, I render one month at a time. Any > suggestions on an efficient way to query the db for all the events in > a given month? I don't know enough about your calendar application, but since we're talking about RFC