Fixes for apidoc
This commit is contained in:
parent
a84a2b51ff
commit
7c5af27ecf
3 changed files with 13 additions and 2 deletions
|
|
@ -135,6 +135,10 @@ def start_app():
|
||||||
|
|
||||||
if not os.path.isfile(file_path):
|
if not os.path.isfile(file_path):
|
||||||
#file_path=workdir+'/modules/'+module+'/media/'+media_file
|
#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
|
file_path=arr_module_path[module]+'/media/'+media_file
|
||||||
|
|
||||||
if not os.path.isfile(file_path):
|
if not os.path.isfile(file_path):
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ class PhangoField:
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
name (str): The name of the field
|
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
|
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.
|
required (bool): If the field is required or not.
|
||||||
size (int): The size of sql field.
|
size (int): The size of sql field.
|
||||||
|
|
@ -54,6 +55,10 @@ class PhangoField:
|
||||||
|
|
||||||
self.name=name
|
self.name=name
|
||||||
|
|
||||||
|
# The type of the field in javascript. Util for api documentation
|
||||||
|
|
||||||
|
self.jtype='string'
|
||||||
|
|
||||||
# The label for the Field
|
# The label for the Field
|
||||||
|
|
||||||
self.label=name.replace('_', ' ').title()
|
self.label=name.replace('_', ' ').title()
|
||||||
|
|
@ -148,6 +153,8 @@ class PhangoField:
|
||||||
|
|
||||||
self.type_sql='varchar({})'.format(self.size)
|
self.type_sql='varchar({})'.format(self.size)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def get_type_sql(self):
|
def get_type_sql(self):
|
||||||
"""This method is used for describe the new field in a sql language format."""
|
"""This method is used for describe the new field in a sql language format."""
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
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:
|
||||||
*args (mixed): The args of function
|
*args (mixed): The args of function
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue