From c61e11992ee29d8d402e82990252d19a8abcf7b0 Mon Sep 17 00:00:00 2001 From: Jonathan Vogl Date: Wed, 8 Nov 2023 15:24:04 +0100 Subject: [PATCH] add handling for id type string --- frost_sta_client/__version__.py | 2 +- frost_sta_client/service/sensorthingsservice.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frost_sta_client/__version__.py b/frost_sta_client/__version__.py index 2e4897b..951404e 100644 --- a/frost_sta_client/__version__.py +++ b/frost_sta_client/__version__.py @@ -1,5 +1,5 @@ __title__ = 'frost_sta_client' -__version__ = '1.1.44' +__version__ = '1.1.45' __license__ = 'LGPL3' __author__ = 'Jonathan Vogl' __copyright__ = 'Fraunhofer IOSB' diff --git a/frost_sta_client/service/sensorthingsservice.py b/frost_sta_client/service/sensorthingsservice.py index 3edd183..cb68e32 100644 --- a/frost_sta_client/service/sensorthingsservice.py +++ b/frost_sta_client/service/sensorthingsservice.py @@ -90,7 +90,8 @@ def get_path(self, parent, relation): if parent is None: return relation this_entity_type = entity_type.get_list_for_class(type(parent)) - return "{entity_type}({id})/{relation}".format(entity_type=this_entity_type, id=parent.id, relation=relation) + _id = f"'{parent.id}'" if isinstance(parent.id, str) else parent.id + return "{entity_type}({id})/{relation}".format(entity_type=this_entity_type, id=_id, relation=relation) def get_full_path(self, parent, relation): slash = "" if self.url.pathstr[-1] == '/' else "/"