From 7c7db5bca0532371594140dd7182a3511467e68e Mon Sep 17 00:00:00 2001 From: Lulzette Date: Mon, 27 Sep 2021 02:25:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20ti?= =?UTF-8?q?mestamp=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=BF=D0=B8=D1=81=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 24d21c8..d701028 100755 --- a/main.py +++ b/main.py @@ -1,7 +1,7 @@ #!/usr/bin/python3 from bottle import abort, route, run, request import pymongo - +import time # TODO: auth to /admin # TODO: timestamps to posts # TODO: author to posts and multiple users @@ -95,7 +95,8 @@ class Back(): return str(posts.update_one({'name': name}, newPost)) # Else - create new else: - newPost = {'name': name, 'text': body} + newPost = {'name': name, 'text': body, + 'create_timestamp': str(time.time())} return str(posts.insert_one(newPost).inserted_id) def deletePost(self, name):