def edit(self, id): c.location = Location.find_by_id(id) defaults = h.object_to_defaults(c.location, 'location') form = render('/location/edit.mako') return htmlfill.render(form, defaults)
def edit(self, id): c.location = Location.find_by_id(id) defaults = h.object_to_defaults(c.location, 'location') form = render('/location/edit.mako') return htmlfill.render(form, defaults)
def _delete(self, id): c.location = Location.find_by_id(id) meta.Session.delete(c.location) meta.Session.commit() h.flash("Location has been deleted.") redirect_to('index')
def _delete(self, id): c.location = Location.find_by_id(id) meta.Session.delete(c.location) meta.Session.commit() h.flash("Location has been deleted.") redirect_to('index')
def delete(self, id): """Delete the location GET will return a form asking for approval. POST requests will delete the item. """ c.location = Location.find_by_id(id) return render('/location/confirm_delete.mako')
def delete(self, id): """Delete the location GET will return a form asking for approval. POST requests will delete the item. """ c.location = Location.find_by_id(id) return render('/location/confirm_delete.mako')
def _edit(self, id): location = Location.find_by_id(id) for key in self.form_result['location']: setattr(location, key, self.form_result['location'][key]) # update the objects with the validated form data meta.Session.commit() h.flash("The Location has been updated successfully.") redirect_to(action='index', id=None)
def _edit(self, id): location = Location.find_by_id(id) for key in self.form_result['location']: setattr(location, key, self.form_result['location'][key]) # update the objects with the validated form data meta.Session.commit() h.flash("The Location has been updated successfully.") redirect_to(action='index', id=None)
def ical(self, id): c.schedule_collection = Location.find_by_id(id).schedule ical = vobject.iCalendar() for schedule in c.schedule_collection: if not schedule.time_slot.heading: event = ical.add('vevent') event.add('uid').value = str(schedule.id) + '@' + Config.get('event_host') # Created tz = timezone(Config.get('time_zone')) event.add('created').value = schedule.creation_timestamp.replace(tzinfo=tz) # Last Modified event.add('dtstamp').value = schedule.last_modification_timestamp.replace(tzinfo=tz) event.add('last-modified').value = schedule.last_modification_timestamp.replace(tzinfo=tz) # Start and End Time event.add('dtstart').value = schedule.time_slot.start_time.replace(tzinfo=tz) event.add('dtend').value = schedule.time_slot.end_time.replace(tzinfo=tz) # Title and Author (need to add Author here) event.add('summary').value = schedule.event.computed_title() + '. ' + h.list_to_string(schedule.event.computed_speakers()) # Abstract, if we have one event.add('description').value = schedule.event.computed_abstract() # Add a URL if schedule.event.proposal: event.add('url').value = h.url_for(qualified=True, controller='schedule', action='view_talk', id=schedule.event.proposal.id) elif not (schedule.event.url is None or schedule.event.url == ''): if schedule.event.url.startswith('https://') or schedule.event.url.startswith('http://'): event.add('url').value = h.url_for(str(schedule.event.url)) else: event.add('url').value = h.url_for(str(schedule.event.url), qualified=True) concurrent_schedules = schedule.event.schedule_by_time_slot(schedule.time_slot) for concurrent_schedule in concurrent_schedules: if concurrent_schedule != schedule: if concurrent_schedule in c.schedule_collection: c.schedule_collection.remove(concurrent_schedule) locations = [concurrent_schedule.location.display_name for concurrent_schedule in concurrent_schedules] event.add('location').value = h.list_to_string(locations) response.charset = 'utf8' response.headers['content-type'] = 'text/calendar; charset=utf8' response.headers.add('content-transfer-encoding', 'binary') response.headers.add('Pragma', 'cache') response.headers.add('Cache-Control', 'max-age=3600,public') return ical.serialize()
def ical(self, id): c.schedule_collection = Location.find_by_id(id).schedule ical = vobject.iCalendar() for schedule in c.schedule_collection: if not schedule.time_slot.heading: event = ical.add('vevent') event.add('uid').value = str(schedule.id) + '@' + h.lca_info['event_host'] # Created event.add('created').value = schedule.creation_timestamp.replace(tzinfo=h.lca_info['time_zone']) # Last Modified event.add('dtstamp').value = schedule.last_modification_timestamp.replace(tzinfo=h.lca_info['time_zone']) event.add('last-modified').value = schedule.last_modification_timestamp.replace(tzinfo=h.lca_info['time_zone']) # Start and End Time event.add('dtstart').value = schedule.time_slot.start_time.replace(tzinfo=h.lca_info['time_zone']) event.add('dtend').value = schedule.time_slot.end_time.replace(tzinfo=h.lca_info['time_zone']) # Title and Author (need to add Author here) event.add('summary').value = schedule.event.computed_title() + '. ' + h.list_to_string(schedule.event.computed_speakers()) # Abstract, if we have one event.add('description').value = schedule.event.computed_abstract() # Add a URL if schedule.event.proposal: event.add('url').value = h.url_for(qualified=True, controller='schedule', action='view_talk', id=schedule.event.proposal.id) elif not (schedule.event.url is None or schedule.event.url == ''): if schedule.event.url.startswith('https://') or schedule.event.url.startswith('http://'): event.add('url').value = h.url_for(str(schedule.event.url)) else: event.add('url').value = h.url_for(str(schedule.event.url), qualified=True) concurrent_schedules = schedule.event.schedule_by_time_slot(schedule.time_slot) for concurrent_schedule in concurrent_schedules: if concurrent_schedule != schedule: if concurrent_schedule in c.schedule_collection: c.schedule_collection.remove(concurrent_schedule) locations = [concurrent_schedule.location.display_name for concurrent_schedule in concurrent_schedules] event.add('location').value = h.list_to_string(locations) response.charset = 'utf8' response.headers['content-type'] = 'text/calendar; charset=utf8' response.headers.add('content-transfer-encoding', 'binary') response.headers.add('Pragma', 'cache') response.headers.add('Cache-Control', 'max-age=3600,public') return ical.serialize()
def view(self, id): c.location = Location.find_by_id(id) return render('/location/view.mako')
def view(self, id): c.location = Location.find_by_id(id) return render('/location/view.mako')