From 8ab985b88e895dc76700c2b3753a22abbfa2fd12 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Thu, 15 Apr 2021 10:37:15 -0700 Subject: [PATCH] add cli command to show post details --- suchwow/app.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/suchwow/app.py b/suchwow/app.py index 6c4c81c..c31c2b8 100644 --- a/suchwow/app.py +++ b/suchwow/app.py @@ -119,5 +119,14 @@ def remove_admin(username): else: print("That moderator doesn't exist") +@app.cli.command("show") +@click.argument("post_id") +def post_id(post_id): + p = Post.filter(id=post_id).first() + if p: + print(p.show()) + else: + print("That post doesn't exist") + if __name__ == "__main__": app.run()