def delete_taskcomponents(self, modifier_id, task_id=None, component_id=None): if task_id is None and component_id is None: raise CoreError("the task_id and component_id can't be None at the same time.") query = TaskComponent.all() if task_id is not None: query.filter("task_id =", task_id) if component_id is not None: query.filter("component_id =", component_id) return query.delete(modifier_id)
def fetch_taskcomponents(self, task_id): query = TaskComponent.all() query.filter("task_id =", task_id) return query.fetch()
def has_taskcomponent(self, task_id, component_id): query = TaskComponent.all() query.filter("task_id =", task_id) query.filter("component_id =", component_id) return query.count() > 0
def delete_taskcomponent(self, task_id , component_id, modifier_id): query = TaskComponent.all() query.filter("task_id =", task_id) query.filter("component_id =", component_id) query.delete(modifier_id)