From 1316c8618944f29bc15c39570c0cf8c205c224bb Mon Sep 17 00:00:00 2001 From: Mustafa Yontar Date: Mon, 1 Feb 2021 14:14:06 +0300 Subject: [PATCH] forget pk queru --- restapi/resource.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/restapi/resource.py b/restapi/resource.py index 81b2364..c66ce7e 100644 --- a/restapi/resource.py +++ b/restapi/resource.py @@ -112,7 +112,7 @@ class Resource: data = self.mongo_qs count = data.count() if pk: - json_data = self.parse_fields(self.model) + json_data = self.parse_fields(self.mongo_qs.get(**{self.as_pk:pk}),self.model) else: data = data[self.offset:self.limit + self.offset] json_data = []