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 case, how do you initially pull your ResourceSchedules
> out of the database? It looks to me like you'd have to pull them all
> out (ie. ResourceSchedule.objects.all()), generate rrules for all of
> them, and see which of the rrules fit into a desired timespan. Is that
> right?
>
> By the way, it warms my heart to see you storing bitfields. My area is
> embedded devices, not web stuff, so I often spend my days working with
> bitfields and masks and such. Good to see that tradition carried into
> some Django :)
>
> Jay P.- Hide quoted text -
>
> - Show quoted text -
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 application I don't have to pull them all out. I'm writing a
booking/scheduleing system and mostly people will search for "things"
on a particular day(s) or for a particular month or between two
specific dates etc. Using the bitmaps and simple bitwise math I can
pull out just the ones that are *likely* to have dates in them.
You could always store another marker or two to give a good first line
SQL filtering depending on how you want to look for them. The idea is
to probably get a few more than you might need, but not *too many*
more! Finding all the records that fall on a monday or in the month of
May is pretty easy with the SQL, then just rrule them to find the
actual dates depending on the other repeat criteria.
Otherwise you would have to pull them all out yes. However, if you
have rules that repeat on every day or every other day you are not
likely to have very many of them for any one specific calendar.
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.
You can then create nice names for the schedules (in the description
field), call them "Weekly", "Monthly", "Every second Thursday" etc.
and have a pick list of common schedules to assign to events or
whatever.
Again, it's probably overkill for a simple calendar, but damn
powerful!! Just some ideas to mull over then :)
Regards,
Gary.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---