Restructured labthings
This commit is contained in:
parent
206dd521ec
commit
a8a3cafa97
39 changed files with 275 additions and 269 deletions
13
openflexure_microscope/common/flask_labthings/utilities.py
Normal file
13
openflexure_microscope/common/flask_labthings/utilities.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
from openflexure_microscope.common.labthings_core.utilities import get_docstring
|
||||
|
||||
|
||||
def description_from_view(view_class):
|
||||
methods = []
|
||||
for method_key in ["get", "post", "put", "delete"]:
|
||||
if hasattr(view_class, method_key):
|
||||
methods.append(method_key.upper())
|
||||
brief_description = get_docstring(view_class).partition("\n")[0].strip()
|
||||
|
||||
d = {"methods": methods, "description": brief_description}
|
||||
|
||||
return d
|
||||
Loading…
Add table
Add a link
Reference in a new issue