dev@locazia: add content list
This commit is contained in:
1 parent
5d486544ca
commit
9e60503262
3 files changed
+40
No files matched your search
@@ -41,3 +41,20 @@ class StoredContent(AlchemyBase):
|
||||
onchain_index=self.onchain_index,
|
||||
accept_type=self.meta.get('content_type', 'image/jpeg')
|
||||
)
|
||||
|
||||
def json_format(self):
|
||||
extra_fields = {}
|
||||
if self.btfs_cid:
|
||||
extra_fields['btfs_cid'] = self.btfs_cid
|
||||
if self.ipfs_cid:
|
||||
extra_fields['ipfs_cid'] = self.ipfs_cid
|
||||
if self.type.startswith('local'):
|
||||
pass
|
||||
|
||||
return {
|
||||
**extra_fields,
|
||||
"hash": self.hash,
|
||||
"cid": self.cid.serialize_v1(),
|
||||
"status": self.status,
|
||||
"meta": self.meta,
|
||||
}
|
||||
Reference in new issue
Block a user