Discussion:
[CalendarX-users] How to upload a large number of events?
Mark Phillips
2006-08-28 19:58:18 UTC
Permalink
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

Loading...