forked from orbit-oss/flask
endpoint is optional for modules. This fixes #86
This commit is contained in:
parent
b1790cca55
commit
f5b8c08284
4 changed files with 35 additions and 7 deletions
|
|
@ -59,6 +59,15 @@ else:
|
|||
_tojson_filter = json.dumps
|
||||
|
||||
|
||||
def _endpoint_from_view_func(view_func):
|
||||
"""Internal helper that returns the default endpoint for a given
|
||||
function. This always is the function name.
|
||||
"""
|
||||
assert view_func is not None, 'expected view func if endpoint ' \
|
||||
'is not provided.'
|
||||
return view_func.__name__
|
||||
|
||||
|
||||
def jsonify(*args, **kwargs):
|
||||
"""Creates a :class:`~flask.Response` with the JSON representation of
|
||||
the given arguments with an `application/json` mimetype. The arguments
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue