Пример #1
0
	def build(self,title,text,tags,author):
		exists = db.questions.find_one(title)
		if exists is None:
			answer = Answer.build(author, text,title,True).save()
			quest = Question(title, tags, answer._id,).save()
			return quest
		else:
			raise askExceptions.NotExist('question',"Already exists with same title"+str(title))
Пример #2
0
	def addAnswer(self,author, text):
		answer = Answer.build(author,text,self.title,False)
		self.answersIds.append(answer._id)
		self.save()