def _process(self): form = AddImagesForm() return WPImages.render_template('images.html', self._conf, images=get_images_for_event( self._conf), event=self._conf, form=form)
def clone(self, new_event, options): from indico.modules.events.layout.models.images import ImageFile if 'images' not in options: return for old_image in get_images_for_event(self.event): new_image = ImageFile(event_id=new_event.id, filename=old_image.filename, content_type=old_image.content_type) with old_image.open() as fd: new_image.save(fd) db.session.add(new_image) db.session.flush() logger.info('Added image during event cloning: {}'.format(new_image))
def clone(self, new_event, options): from indico.modules.events.layout.models.images import ImageFile if 'images' not in options: return for old_image in get_images_for_event(self.event): new_image = ImageFile(event_id=new_event.id, filename=old_image.filename, content_type=old_image.content_type) with old_image.open() as fd: new_image.save(fd) db.session.add(new_image) db.session.flush() logger.info( 'Added image during event cloning: {}'.format(new_image))
def _render_image_list(event): return render_template('events/layout/image_list.html', images=get_images_for_event(event))
def _process(self): form = AddImagesForm() return WPImages.render_template('images.html', self._conf, images=get_images_for_event(self._conf), event=self._conf, form=form)