def get(self, showingkey): showing = Showing.get(showingkey) if showing: calendar = tasks.generate_ics([showing,], showing.master_location) if calendar is not None: self.response.headers['Content-Type'] = "text/calendar" self.response.out.write(calendar.as_string()) else: self.error(404)
def get(self, showingkey): showing = Showing.get(showingkey) if showing: self.redirect( "http://www.google.com/calendar/event?action=TEMPLATE&text=%s&dates=%s/%s&location=%s&details=%s&sprop=website:http://bfical.burry.name/&sprop=name:BFiCal" % (showing.parent().name, showing.start.replace(tzinfo=GB_TZ).astimezone(pytz.utc).strftime("%Y%m%dT%H%M%SZ"), showing.end.replace(tzinfo=GB_TZ).astimezone(pytz.utc).strftime("%Y%m%dT%H%M%SZ"), '%s, BFI %s, London' % (showing.location, showing.master_location.capitalize()), showing.parent().precis, )) else: self.error(404)