Example #1
0
 def save(self):
     question = Question(**self.cleaned_data)   
     user,_ = User.objects.get_or_create(username='******',password='******')
     question.author=user
     question.added_at=datetime.today()
     question.save()
     return question
Example #2
0
 def save(self):
     question = Question(**self.cleaned_data)
     question.added_at = datetime.now()
     question.rating = 0
     question.author = self._user
     question.save()
     return question
Example #3
0
 def save(self):
     question = Question(**self.cleaned_data)
     #t7          user,_ = User.objects.get_or_create(username='******',password='******')
     #t7          question.author=user
     question.author_id = self._user.id
     question.added_at = datetime.today()
     if self._user.id is None:
         user, _ = User.objects.get_or_create(username='******',
                                              password='******')
         question.author = user
     else:
         pass
     question.save()
     return question