Many fixes and docstrings
This commit is contained in:
parent
eb93be38ea
commit
dd67eafd0d
5 changed files with 118 additions and 10 deletions
|
|
@ -6,6 +6,17 @@ 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)
|
||||
|
||||
|
|
@ -30,6 +41,17 @@ 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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue