1
0
mirror of https://github.com/aquatix/digimarks.git synced 2025-12-06 20:55:10 +01:00

Properly serialise bookmarks

This commit is contained in:
2018-03-17 15:46:54 +01:00
parent 9539c48b7b
commit 45c95f5f17

View File

@@ -375,6 +375,11 @@ class Bookmark(BaseModel):
return result
@property
def serialize(self):
return self.to_dict()
class PublicTag(BaseModel):
""" Publicly shared tag """
tagkey = CharField()
@@ -499,13 +504,10 @@ def bookmarks_page(userkey, filtermethod=None, sortmethod=None):
def bookmarks_json(userkey, filtermethod=None, sortmethod=None):
bookmarks, bookmarktags, filter_text, message = get_bookmarks(userkey, filtermethod, sortmethod)
bookmarkslist = []
for bookmark in bookmarks:
bookmarkslist.append(bookmark)
bookmarkslist = [i.serialize for i in bookmarks]
the_data = {
'bookmarks': bookmarks,
'bookmarks': bookmarkslist,
'tags': bookmarktags,
'filter_text': filter_text,
'message': message,