@@ -50,9 +50,7 @@ class CoreClient(AsyncBaseCoreClient):
50
50
async def all_collections (self , ** kwargs ) -> Collections :
51
51
"""Read all collections from the database."""
52
52
base_url = str (kwargs ["request" ].base_url )
53
- serialized_collections = await self .database .get_all_collections (
54
- base_url = base_url
55
- )
53
+ collection_list = await self .database .get_all_collections (base_url = base_url )
56
54
57
55
links = [
58
56
{
@@ -71,10 +69,8 @@ async def all_collections(self, **kwargs) -> Collections:
71
69
"href" : urljoin (base_url , "collections" ),
72
70
},
73
71
]
74
- collection_list = Collections (
75
- collections = serialized_collections or [], links = links
76
- )
77
- return collection_list
72
+
73
+ return Collections (collections = collection_list , links = links )
78
74
79
75
@overrides
80
76
async def get_collection (self , collection_id : str , ** kwargs ) -> Collection :
@@ -91,22 +87,22 @@ async def item_collection(
91
87
links = []
92
88
base_url = str (kwargs ["request" ].base_url )
93
89
94
- serialized_children , maybe_count = await self .database .get_collection_items (
90
+ items , maybe_count = await self .database .get_collection_items (
95
91
collection_id = collection_id , limit = limit , base_url = base_url
96
92
)
97
93
98
94
context_obj = None
99
95
if self .extension_is_enabled ("ContextExtension" ):
100
96
context_obj = {
101
- "returned" : len (serialized_children ),
97
+ "returned" : len (items ),
102
98
"limit" : limit ,
103
99
}
104
100
if maybe_count is not None :
105
101
context_obj ["matched" ] = maybe_count
106
102
107
103
return ItemCollection (
108
104
type = "FeatureCollection" ,
109
- features = serialized_children ,
105
+ features = items ,
110
106
links = links ,
111
107
context = context_obj ,
112
108
)
0 commit comments