From 7c5af27ecf8f3a9d1d3056955636431074cbe6c3 Mon Sep 17 00:00:00 2001 From: Antonio de la Rosa Date: Tue, 13 May 2025 01:56:55 +0200 Subject: [PATCH] Fixes for apidoc --- paramecio2/app.py | 6 +++++- paramecio2/libraries/db/webmodel.py | 7 +++++++ paramecio2/libraries/plugins.py | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/paramecio2/app.py b/paramecio2/app.py index aa9609e..68999fa 100644 --- a/paramecio2/app.py +++ b/paramecio2/app.py @@ -135,8 +135,12 @@ def start_app(): if not os.path.isfile(file_path): #file_path=workdir+'/modules/'+module+'/media/'+media_file + + if not module in arr_module_path: + abort(404) + file_path=arr_module_path[module]+'/media/'+media_file - + if not os.path.isfile(file_path): abort(404) diff --git a/paramecio2/libraries/db/webmodel.py b/paramecio2/libraries/db/webmodel.py index 869429b..0f52b2c 100644 --- a/paramecio2/libraries/db/webmodel.py +++ b/paramecio2/libraries/db/webmodel.py @@ -25,6 +25,7 @@ class PhangoField: Attributes: name (str): The name of the field + jtype(Python type): The type of value in python label (str): A label or generic name for use in text labels used for representate the field required (bool): If the field is required or not. size (int): The size of sql field. @@ -54,6 +55,10 @@ class PhangoField: self.name=name + # The type of the field in javascript. Util for api documentation + + self.jtype='string' + # The label for the Field self.label=name.replace('_', ' ').title() @@ -147,6 +152,8 @@ class PhangoField: self.help='' self.type_sql='varchar({})'.format(self.size) + + def get_type_sql(self): """This method is used for describe the new field in a sql language format.""" diff --git a/paramecio2/libraries/plugins.py b/paramecio2/libraries/plugins.py index f44ca58..b29389f 100644 --- a/paramecio2/libraries/plugins.py +++ b/paramecio2/libraries/plugins.py @@ -32,7 +32,7 @@ def db(f): """Wrapper function for add db connection to your flask function - Wrapper function for add db connection to your flask function. Also close the connection if error or function exection is finished. + Wrapper function for add db connection to your flask function. Also close the connection if error or function exception is finished. Args: *args (mixed): The args of function