diff --git a/ereuse_devicehub/config.py b/ereuse_devicehub/config.py index 7c28f5fd..d5226c26 100644 --- a/ereuse_devicehub/config.py +++ b/ereuse_devicehub/config.py @@ -14,7 +14,7 @@ from ereuse_devicehub.resources.device import definitions from ereuse_devicehub.resources.documents import documents from ereuse_devicehub.resources.enums import PriceSoftware from ereuse_devicehub.resources.versions import versions -from ereuse_devicehub.resources.rent import definitions as rent_def +from ereuse_devicehub.resources.assigned import definitions as assigned_def class DevicehubConfig(Config): @@ -29,7 +29,7 @@ class DevicehubConfig(Config): import_resource(documents), import_resource(inventory), import_resource(versions), - import_resource(rent_def)), + import_resource(assigned_def)), ) PASSWORD_SCHEMES = {'pbkdf2_sha256'} # type: Set[str] DB_USER = config('DB_USER', 'dhub') diff --git a/ereuse_devicehub/resources/rent/__init__.py b/ereuse_devicehub/resources/assigned/__init__.py similarity index 100% rename from ereuse_devicehub/resources/rent/__init__.py rename to ereuse_devicehub/resources/assigned/__init__.py diff --git a/ereuse_devicehub/resources/assigned/definitions.py b/ereuse_devicehub/resources/assigned/definitions.py new file mode 100644 index 00000000..f2ce97ba --- /dev/null +++ b/ereuse_devicehub/resources/assigned/definitions.py @@ -0,0 +1,9 @@ +from typing import Callable, Iterable, Tuple +from ereuse_devicehub.resources.action import schemas +from teal.resource import Resource +from ereuse_devicehub.resources.assigned.views import AssignedView + + +class AssignedDef(Resource): + VIEW = AssignedView + SCHEMA = schemas.Assigned diff --git a/ereuse_devicehub/resources/rent/views.py b/ereuse_devicehub/resources/assigned/views.py similarity index 98% rename from ereuse_devicehub/resources/rent/views.py rename to ereuse_devicehub/resources/assigned/views.py index e8ed15ad..e07471cd 100644 --- a/ereuse_devicehub/resources/rent/views.py +++ b/ereuse_devicehub/resources/assigned/views.py @@ -10,7 +10,7 @@ from ereuse_devicehub.query import things_response from ereuse_devicehub.resources.action.models import Assigned -class RentingView(View): +class AssignedView(View): @auth.Auth.requires_auth def get(self, id: uuid.UUID) -> Assigned: return super().get(id) diff --git a/ereuse_devicehub/resources/rent/definitions.py b/ereuse_devicehub/resources/rent/definitions.py deleted file mode 100644 index e87e0f72..00000000 --- a/ereuse_devicehub/resources/rent/definitions.py +++ /dev/null @@ -1,8 +0,0 @@ -from ereuse_devicehub.resources.action import schemas -from teal.resource import Resource -from ereuse_devicehub.resources.rent.views import RentingView - - -class RentDef(Resource): - VIEW = RentingView - SCHEMA = schemas.Assigned