From 37c4065f06f7cdaa35a49c7a6168f50394b37565 Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Thu, 19 Oct 2023 13:36:00 +0200 Subject: cli: objects: use --desc and --folder Try to reduce the usage of different parameter names due to the OpenGnsys database using different column names for similar purposes. Any database field regarding a description of some sort will use the parameter --desc, even if the DB uses another column name (for example, comment column in center table). Use --folder parameter when requiring a folder id. The database uses "grupo" as table name but present this to the user as folder, so use --folder instead of --group. Also, add 'location' field in the payload of "add room" command, it was missing the addition of 'location' field in the JSON payload. --- cli/objects/center.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cli/objects/center.py') diff --git a/cli/objects/center.py b/cli/objects/center.py index 1869efd..2e851d3 100644 --- a/cli/objects/center.py +++ b/cli/objects/center.py @@ -8,14 +8,14 @@ class OgCenter(): nargs='?', required=True, help='Name of the center') - parser.add_argument('--comment', + parser.add_argument('--desc', nargs='?', required=False, help='(Optional) Provide a more detailed description of the center') parsed_args = parser.parse_args(args) payload = {'name': parsed_args.name} - if parsed_args.comment: - payload['comment'] = parsed_args.comment + if parsed_args.desc: + payload['comment'] = parsed_args.desc rest.post('/center/add', payload=payload) @staticmethod -- cgit v1.2.3-18-g5258