def apply(data: List[Dict]): for view in data: if isinstance(view, dict): view = DataView.get_or_create(**view, session=user.session()) user.session().commit() on_finish()
def __init__(self, views): self.views = list() for view in views: if isinstance(view, dict): view = DataView.get_or_create(**view) self.views.append(view)