Fixes in documentation

This commit is contained in:
absurdo 2023-11-04 21:15:44 +01:00
parent cfb70403c1
commit dc58175760
13 changed files with 119 additions and 113 deletions

View file

@ -6,22 +6,23 @@ login_name='login'
login_url='.login'
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.
Args:
*args : The args of function
**kwds : Standard python extra arguments of function
Returns:
wrapper (function): Return the wrapper.
"""
@wraps(f)
def wrapper(*args, **kwds):
"""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.
Args:
*args (mixed): The args of function
**kwds (mixed): Standard python extra arguments of function
Returns:
wrapper (function): Return the wrapper.
"""
g.connection=WebModel.connection()
try:
@ -41,22 +42,24 @@ def db(f):
return wrapper
def login_site(f):
"""Wrapper function for check login in your flask function
Wrapper function for check a login session in your flask function. If
Args:
*args : The args of function
**kwds : Standard python extra arguments of function
Returns:
wrapper (function): Return the wrapper.
"""
@wraps(f)
def wrapper(*args, **kwds):
"""Wrapper function for check login in your flask function
Wrapper function for check a login session in your flask function. If
Args:
*args : The args of function
**kwds : Standard python extra arguments of function
Returns:
wrapper (function): Return the wrapper.
"""
if not login_name in session:
return redirect(url_for(login_url))