diff --git a/src/pyelephant.py b/src/pyelephant.py index 86990d4..e9732ad 100755 --- a/src/pyelephant.py +++ b/src/pyelephant.py @@ -10,8 +10,10 @@ Task = None ############################################################################### def add(session: sa.orm.Session, title: str): - session.add(Task(title=title)) + obj = Task(title=title) + session.add(obj) session.commit() + show_by_obj(obj) # ----------------------------------------------------------------------------- @@ -34,7 +36,7 @@ def show_by_id(session: sa.orm.Session, index: int): # ----------------------------------------------------------------------------- def ls(session: sa.orm.Session): for i in session.query(Task).order_by(Task.created_at): - print(i.id, i.created_at, i.title) + show_by_obj(session, i) ###############################################################################