def construct_response(exit_code: int, message: str) -> Response:
"""
Construct a Flask-suitable response
:param exit_code: 0 or something else
:param message: something useful
:return: a Flask-suitable response
"""
@app.route(f"/{version}/<page>", methods=[GET, POST])
def serve(page) -> Response:
"""
Do some stuff and return 200 or 500
:param page: this is a REST endpoint we are advertising to callers
:return: a Flask Response generated by construct_response
"""
Question 1: how do I embed in the serve function docstring a link to the construct_response function?
Question 2: how do I embed in, for example, lib/stuff3.py, a link to the construct_response function?
I tried:
:ref:`my_project/api/stuff1:construct_response`
but that gives an undefined label warning.
def construct_response(exit_code: int, message: str) -> Response:
"""
Construct a Flask-suitable response
:param exit_code: 0 or something else
:param message: something useful
:return: a Flask-suitable response
"""
@app.route(f"/{version}/<page>", methods=[GET, POST])
def serve(page) -> Response:
"""
Do some stuff and return 200 or 500
:param page: this is a REST endpoint we are advertising to callers
:return: a Flask Response generated by construct_response
"""
Question 1: how do I embed in the serve function docstring a link to the
construct_response function?
Question 2: how do I embed in, for example, lib/stuff3.py, a link to the
construct_response function?
I tried:
:ref:`my_project/api/stuff1:construct_response`
but that gives an undefined label warning.
I can answer my own Question 1:
:func:`construct_response`
"""
Construct a Flask-suitable response
:param exit_code: 0 or something else
:param message: something useful
:return: a Flask-suitable response
"""
@app.route(f"/{version}/<page>", methods=[GET, POST])
def serve(page) -> Response:
"""
Do some stuff and return 200 or 500
:param page: this is a REST endpoint we are advertising to callers
:return: a Flask Response generated by construct_response
"""
Question 1: how do I embed in the serve function docstring a link to the
construct_response function?
Question 2: how do I embed in, for example, lib/stuff3.py, a link to the
construct_response function?
I tried:
:ref:`my_project/api/stuff1:construct_response`
but that gives an undefined label warning.
I can answer my own Question 1:
:func:`construct_response`
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (0 / 16) |
Uptime: | 170:05:04 |
Calls: | 10,385 |
Calls today: | 2 |
Files: | 14,057 |
Messages: | 6,416,555 |