Switched to ActionView and PropertyView from decorators
This commit is contained in:
parent
677b08d509
commit
1819ca6a9c
18 changed files with 57 additions and 98 deletions
|
|
@ -1,5 +1,5 @@
|
|||
from labthings.server.extensions import BaseExtension
|
||||
from labthings.server.view import View
|
||||
from labthings.server.view import View, PropertyView
|
||||
from labthings.server.decorators import ThingProperty, PropertySchema, use_args
|
||||
from labthings.server import fields
|
||||
from labthings.server.find import find_component
|
||||
|
|
@ -190,8 +190,7 @@ class AutostorageExtension(BaseExtension):
|
|||
autostorage_extension_v2 = AutostorageExtension()
|
||||
|
||||
|
||||
@ThingProperty
|
||||
class GetLocationsView(View):
|
||||
class GetLocationsView(PropertyView):
|
||||
def get(self):
|
||||
global autostorage_extension_v2
|
||||
|
||||
|
|
@ -199,9 +198,8 @@ class GetLocationsView(View):
|
|||
return autostorage_extension_v2.get_locations()
|
||||
|
||||
|
||||
@ThingProperty
|
||||
@PropertySchema(fields.String(required=True, example="Default"))
|
||||
class PreferredLocationView(View):
|
||||
class PreferredLocationView(PropertyView):
|
||||
def get(self):
|
||||
global autostorage_extension_v2
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue