Using vObject
Diez B. Roggisch
deets at nospam.web.de
Tue Sep 23 03:09:07 EDT 2008
Joshua Gardner schrieb:
> I'm brand new to USENET so please bear with me.
>
> I'm writing a specialized to-do list app. I'm using Django but this is
> not a question about Django. It has to have recurring tasks set by the
> managers for the employees to then check off.
>
> I've got pretty much everything in the app worked out, except for one
> thing: the repeating tasks. I want to have it so that the manager puts
> in a repeating task with a description and a repeat rule. This rule then
> generates simpler one-time tasks. These one-time tasks have a
> description, a time (a datetime.datetime object) and "completed" boolean.
>
> I've looked around and think I have these options:
> 1. Manually put it all together with another Django model that
> implements the repeat rules.
> 2. Do the same thing but use dateutil.rrule to help.
> 3. Use the icalendar (http://codespeak.net/icalendar/) module to access
> ICS files.
> 4. vObject (http://vobject.skyhouseconsulting.com/) to do the same.
>
> I think I want to use vObject because it uses dateutil and the
> management can easily manage tasks from a desktop app.
>
> Only thing is that I find vObject's documentation very cryptic and was
> wondering if anybody here could shed some light on how to use vObject. A
> simple "getting-started" tutorial or something similar would be nice.
I think you are going down a wrong route here. I have implemented a
reservation management application for a museum in TurboGears - and
while I use icalendar to support ICS-based viewing of the reservations,
I completely manage * store them based on my own model.
In case of the recurring events, I have one master-event, that defines
the start & recurrence-options.
I then create child-events that essentially are write-protected (all
editing goes to the master), and serve only as place-holder. But if you
want, you can "detach" them, to make them live on their own.
The reason for this is simple: if you want to display views of your
tasks based on e.g. a specific day, you can query the database. Simple
queries will yield a list of tasks needed.
Whereas all ICS-based approaches listed above, including vObject, would
mean that you
- extract *all* the ics-data from the database, not really knowing if
there is anything relevant in there for the current view
- potentially expand the events in there, manually or through some
methods the libraries expose
- filter the results.
All of this is going to consume much useless time.
So I would suggest you use approach 1, possibly 2 (don't know rrule).
Diez
More information about the Python-list
mailing list