Example #1
0
def commitComment(userID, Comment):
    session = Database.Session()
    Comment = Database.tComments(postID=Comment['postID'],
                                 userID=userID,
                                 Comment=Comment['Comment'],
                                 ts=datetime.datetime.now(),
                                 image=None)
    session.add(Comment)
    session.commit()
Example #2
0
def Comment(postID):
    postID = str(postID)
    Comment = request.form['Comment']
    session = Database.Session()
    Comment = Database.tComments(postID=postID,
                                 userID=current_user.id,
                                 Comment=Comment,
                                 ts=datetime.datetime.now(),
                                 image=None)
    session.add(Comment)
    session.commit()
    return redirect('/View/Post/' + postID)