Added example dynamic form

This commit is contained in:
Joel Collins 2019-11-27 14:34:52 +00:00
parent 45e7bcb167
commit 1db88548c8
3 changed files with 78 additions and 0 deletions

View file

@ -0,0 +1,24 @@
from openflexure_microscope.devel import (
MicroscopeViewPlugin,
JsonResponse,
request,
jsonify,
taskify,
)
import logging
class DoAPI(MicroscopeViewPlugin):
"""
A dynamic example API plugin
"""
def get(self):
values = {"val_int": self.plugin.val_int}
return jsonify(values)
def post(self):
self.plugin.val_int += 1
return jsonify({"response": "completed"})