def get_web_step_data(request, step_data, model, images_url): filename = step_data['image_filename'].split(os.path.sep)[-1] image_url = request.static_url( 'webgnome:static/%s/%s/%s/%s' % (images_url, model.id, util.get_filename_safe_time( model.changed_at), filename)) return { 'id': step_data['step_num'], 'url': image_url, 'timestamp': step_data['time_stamp'] }
def get_web_step_data(request, step_data, model, images_url): filename = step_data['image_filename'].split(os.path.sep)[-1] image_url = request.static_url( 'webgnome:static/%s/%s/%s/%s' % ( images_url, model.id, util.get_filename_safe_time(model.changed_at), filename)) return { 'id': step_data['step_num'], 'url': image_url, 'timestamp': step_data['time_stamp'] }
def data_dir(self): """ Return the expected path to the files for the current run of the model. This path is bound to the current value of ``self.changed_at`` so that we can invalidate a browser-based image cache when a model changes. """ if not self.base_dir: return return os.path.join(self.base_dir, util.get_filename_safe_time(self.changed_at))