Пример #1
0
 def post_question(self):
     quesID = QUESTIONS_COLLECTION.insert_one({
         'short_description': self.short_description,
         'long_description': self.long_description,
         'posetdBy': self.posetdBy,
         'timestamp': self.timestamp,
         'ansID': []
     }).inserted_id
     usr = User(self.posetdBy)
     usr.update_questions(str(quesID))
     return quesID
Пример #2
0
 def postQuestion(self):
     quesID = QUESTIONS_COLLECTION.insert_one({
         'postedBy': self.postedBy,
         'short_description': self.short_description,
         'long_description': self.long_description,
         'timestamp': self.timestamp,
         'ansID': [],
         'commentID': [],
         'votes': 0,
         'accepted_ans': None,
         'flag': False
     }).inserted_id
     usr = User(self.postedBy)
     usr.update_questions(str(quesID))
     return quesID