if self.url:
user.update({"url": self.url})
if self.location:
- user.update({"location": self.get_location.seralize(request)})
+ user.update({"location": self.get_location.serialize(request)})
return user
"id": self.id,
"author": author.serialize(request),
"objectType": self.object_type,
- "url": self.url_for_self(request.urlgen),
+ "url": self.url_for_self(request.urlgen, qualified=True),
"image": {
"url": request.host_url + self.thumb_url[1:],
},
creator=self.creator,
title=safe_title)
+ def serialize(self, request):
+ # Get all serialized output in a list
+ items = []
+ for item in self.get_collection_items():
+ items.append(item.serialize(request))
+
+ return {
+ "totalItems": self.items,
+ "url": self.url_for_self(request.urlgen, qualified=True),
+ "items": items,
+ }
+
class CollectionItem(Base, CollectionItemMixin):
__tablename__ = "core__collection_items"
collection=self.collection,
entry=self.media_entry)
+ def serialize(self, request):
+ return self.get_media_entry.serialize(request)
+
class ProcessingMetaData(Base):
__tablename__ = 'core__processing_metadata'