From 1ad18d53e5dab201b02f610ee46f8ec7a53b2fe4 Mon Sep 17 00:00:00 2001
From: Pavel Kirilin <win10@list.ru>
Date: Wed, 13 Oct 2021 02:03:28 +0400
Subject: [PATCH] Updated CLI parameters and README. (#42)

---
 README.md               | 4 ++--
 fastapi_template/cli.py | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index c552391..cdd5bb5 100644
--- a/README.md
+++ b/README.md
@@ -56,7 +56,7 @@ $ python -m fastapi_template --help
 usage: FastAPI template [-h] [--version] [--name PROJECT_NAME]
                         [--description PROJECT_DESCRIPTION]
                         [--db {none,sqlite,mysql,postgresql}]
-                        [--orm {none,ormar,sqlalchemy,tortoise}]
+                        [--orm {ormar,sqlalchemy,tortoise}]
                         [--ci {none,gitlab,github}] [--redis] [--migrations]
                         [--kube] [--dummy] [--routers] [--swagger] [--force]
 
@@ -68,7 +68,7 @@ optional arguments:
                         Project description
   --db {none,sqlite,mysql,postgresql}
                         Database
-  --orm {none,ormar,sqlalchemy,tortoise}
+  --orm {ormar,sqlalchemy,tortoise}
                         ORM
   --ci {none,gitlab,github}
                         Choose CI support
diff --git a/fastapi_template/cli.py b/fastapi_template/cli.py
index c0f0fde..b0933e1 100644
--- a/fastapi_template/cli.py
+++ b/fastapi_template/cli.py
@@ -56,7 +56,7 @@ def parse_args():
         "--orm",
         help="ORM",
         type=str,
-        choices=list(map(attrgetter("value"), ORM)),
+        choices=[orm.value for orm in ORM if orm != ORM.none],
         default=None,
         dest="orm",
     )
@@ -65,7 +65,7 @@ def parse_args():
         help="Choose CI support",
         default=None,
         type=str,
-        choices=list(map(attrgetter("value"), CIType)),
+        choices=[ci.value for ci in CIType],
         dest="ci_type",
     )
     parser.add_argument(
@@ -192,7 +192,7 @@ def read_user_input(current_context: BuilderContext) -> BuilderContext:
         current_context.orm = radiolist_dialog(
             "ORM",
             text="Which ORM do you want?",
-            values=[(orm, orm.value) for orm in list(ORM)],
+            values=[(orm, orm.value) for orm in list(ORM) if orm != ORM.none],
         ).run()
         if current_context.orm is None:
             raise KeyboardInterrupt()
-- 
GitLab