[Setup] How to bulk add a set of events?

Mark Phillips mark at phillipsmarketing.biz
Mon Aug 28 16:43:20 UTC 2006


Does anyone know of a script that can be used to add a large set of events
to a plone site (v 2.1.3 and zope 2.8) from an external file? 

I have a fairly large set of repeating events over the next 6 months, and it
would be faster to upload them from a script rather than copy/paste events
one at a time.

If not, can someone point me in the right direction to write such a script?
I found a script in the "Definitive Guide to Plone" (pgs 267-270) for
uploading a large set of members from a csv file. The general approach was:

pr = self.portal_registration
pg = self. portal_groups

# import local csv file
# parse a line, extract the first, last, email
# create password

try:
    # add member
     pr.addMember(id = id,
                      password = password,
                              roles = ['Member',]
                              properties = {
                  'fullname':name,
                  'username'=id,
                  'email'=email,
                      }
        )
     # Add member to group using self.portal_groups
# done

I looked in Event.py and found an addEvent method. The question is, what is
the equivalent to self.portal_registration for adding an Event?

Thanks!

Mark





More information about the Setup mailing list