def post_answer(self): ansID = ANSWERS_COLLECTION.insert_one({ 'postedBy': self.postedBy, 'quesID': self.quesID, 'ansText': self.ansText, 'timestamp': self.timestamp, 'quesID': self.quesID, 'commentID': [], 'votes': 0, 'flaggedBy': [], 'flag': 'False'}).inserted_id usr = User(self.postedBy) usr.update_answers(str(ansID)) ques = QuestionMethods(self.quesID) ques.insert_answers(str(ansID)) return ansID
def post_answer(self): ansID = ANSWERS_COLLECTION.insert_one({ 'posetdBy': self.posetdBy, 'quesID': self.quesID, 'ansText': self.ansText, 'timestamp': self.timestamp, 'quesID': self.quesID }).inserted_id usr = User(self.posetdBy) usr.update_answers(str(ansID)) ques = QuestionMethods(self.quesID) ques.update_answers(str(ansID)) return ansID