From 95fbafb217c2e3b8c851b3977bb8e2be67d3b8a3 Mon Sep 17 00:00:00 2001 From: Wolfgang Ludger Hottgenroth Date: Sat, 28 Aug 2021 21:12:08 +0200 Subject: [PATCH] generated comment --- api/methods.py | 5 +++++ api/methods.py.tmpl | 2 ++ generate.py | 9 +++++++++ schema/create.sql.tmpl | 2 ++ 4 files changed, 18 insertions(+) diff --git a/api/methods.py b/api/methods.py index 22ceb89..2fa5e76 100644 --- a/api/methods.py +++ b/api/methods.py @@ -1,3 +1,8 @@ + +# THIS FILE HAS BEEN GENERATED +# DO NOT EDIT MANUALLY + + from db import dbGetMany, dbGetOne def get_accounts(user, token_info): diff --git a/api/methods.py.tmpl b/api/methods.py.tmpl index 0dcc5f5..d86ecee 100644 --- a/api/methods.py.tmpl +++ b/api/methods.py.tmpl @@ -1,3 +1,5 @@ +$GENERATED_PYTHON_COMMENT + from db import dbGetMany, dbGetOne #for $table in $tables diff --git a/generate.py b/generate.py index 1884ce0..36be5a6 100644 --- a/generate.py +++ b/generate.py @@ -42,6 +42,15 @@ for table in schema["tables"]: column["jstype"] = 'number' table["selectors"] = [ y["name"] for y in sorted([ x for x in columns if "selector" in x ], key=lambda x: x["selector"])] +schema["GENERATED_SQL_COMMENT"] = """ +-- THIS FILE HAS BEEN GENERATED +-- DO NOT EDIT MANUALLY +""" +schema["GENERATED_PYTHON_COMMENT"] = """ +# THIS FILE HAS BEEN GENERATED +# DO NOT EDIT MANUALLY +""" + for f in glob.glob(args.template): print(f"process {f}") tmpl = Template(file=f, searchList=[schema]) diff --git a/schema/create.sql.tmpl b/schema/create.sql.tmpl index cab8046..9a17e36 100644 --- a/schema/create.sql.tmpl +++ b/schema/create.sql.tmpl @@ -1,3 +1,5 @@ +$GENERATED_SQL_COMMENT + #for $table in $tables CREATE TABLE ${table.name}_t ( id serial not null primary key