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