Пример #1
0
 def submit_answer(self,user):
     self.save()
     question=Question.objects.get(pk=self.question_id)
     question.answercount+=1
     question.save()
     answer_submit_done.send(sender=Answer,obj=self,user=user,question=question)
     return self.id
Пример #2
0
 def create(self, answer_id, **kwargs):
     "添加redis缓存,同时获取id"
     answer = super(AnswerManager, self).create(id=answer_id, **kwargs)
     answer_submit_done.send(sender=Answer,
                             obj=answer,
                             user=kwargs.get("user"),
                             question=kwargs.get("question"))
     return answer
Пример #3
0
 def submit_answer(self, user):
     add_answer(self)
     self.save()
     question = Question.objects.get(pk=self.question_id)
     question.answercount += 1
     question.save()
     answer_submit_done.send(sender=Answer,
                             obj=self,
                             user=user,
                             question=question)
     return self.id
Пример #4
0
 def create(self,answer_id,**kwargs):
     "添加redis缓存,同时获取id"
     answer=super(AnswerManager,self).create(id=answer_id,**kwargs)
     answer_submit_done.send(sender=Answer,obj=answer,user=kwargs.get("user"),question=kwargs.get("question"))
     return answer