def get(self): cnt = 0 for taskcls in tasklist: task = taskcls() t = Migration.all().filter('name =', task.name).get() if t is None: task.call(self.response.out) m = Migration(name=task.name) m.put() self.response.out.write('Performed task: %s.<br/>' % task.name) cnt += 1 else: logging.info('Task %s already performed' % task.name) self.response.out.write('%s tasks have been executed<br/>' % cnt)
def migration_task(task): task.call(out) m = Migration(name=task.name) m.put()