Tweak how we return single record data from API
i.e. always return 'data' key with object data, regardless of model
This commit is contained in:
parent
56974ce30f
commit
7aa5c8e724
|
@ -226,7 +226,9 @@ class APIMasterView(APIView):
|
||||||
obj = self.Session.query(self.get_model_class()).get(uuid)
|
obj = self.Session.query(self.get_model_class()).get(uuid)
|
||||||
if not obj:
|
if not obj:
|
||||||
raise self.notfound()
|
raise self.notfound()
|
||||||
return {self.get_object_key(): self.normalize(obj)}
|
key = self.get_object_key()
|
||||||
|
normal = self.normalize(obj)
|
||||||
|
return {key: normal, 'data': normal}
|
||||||
|
|
||||||
def _collection_post(self):
|
def _collection_post(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue