diff --git a/src/pyelephant.py b/src/pyelephant.py index e9732ad..4369b81 100755 --- a/src/pyelephant.py +++ b/src/pyelephant.py @@ -18,7 +18,7 @@ def add(session: sa.orm.Session, title: str): # ----------------------------------------------------------------------------- def rm(session: sa.orm.Session, index: int): - session.query(Task.id == index).delete() + session.query(Task).filter(Task.id == index).delete() session.commit() @@ -29,8 +29,8 @@ def show_by_obj(session: sa.orm.Session, obj: Task): # ----------------------------------------------------------------------------- def show_by_id(session: sa.orm.Session, index: int): - obj = session.query(Task.id == index) - show_by_obj(obj) + obj = session.query(Task).filter(Task.id == index).one() + show_by_obj(session, obj) # -----------------------------------------------------------------------------