Improved xml export
This commit is contained in:
parent
38c05e3ce3
commit
650722a079
1 changed files with 3 additions and 1 deletions
|
@ -316,11 +316,13 @@ def list(count=100, format="HTML"):
|
|||
elif format == "xml":
|
||||
blist = Bookmark.objects(deleted=False).order_by("-created_at").only("url","title","short","note","created_at","tags","unread").limit(count)
|
||||
out = "<xml>\n"
|
||||
out += "\t<title>Bookmark Export "+datetime.datetime.now().strftime("%Y-%m-%d")+"</title>\n"
|
||||
out += "\t<created_at>"+datetime.datetime.now().isoformat()+"</created_at>\n"
|
||||
for b in blist:
|
||||
out += "\t<bookmark>\n"
|
||||
out += "\t\t<title>"+b.title+"</title>\n"
|
||||
out += "\t\t<short>"+b.short+"</short>\n"
|
||||
out += "\t\t<created_at>"+b.created_at.strftime("%Y-%m-%d %H:%M:%S")+"</created_at>\n"
|
||||
out += "\t\t<created_at>"+b.created_at.isoformat()+"</created_at>\n"
|
||||
out += "\t\t<unread>"
|
||||
if b.unread:
|
||||
out += "True"
|
||||
|
|
Loading…
Reference in a new issue