## Controller Python Script "calendar_upload" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind state=state ##bind subpath=traverse_subpath ##parameters=file='', file_data='' ##title=Upload Calendar ## from StringIO import StringIO if file and hasattr(file, 'seek'): file.seek(0) if not file and file_data: file = StringIO(file_data) context.fromFile(file) from Products.CMFPlone import transaction_note transaction_note('Uploaded calendar %s from uploaded file at %s' % (context.title_or_id(), context.absolute_url())) return state.set(context=context, portal_status_message='Calendar Uploaded.')