示例#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
示例#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
示例#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
示例#4
0
 def save(self):
     question = Question(**self.cleaned_data)
     question.author = self._user
     question.save()
     return question
 def save(self):
     question = Question(**self.cleaned_data)
     question.author = self.instance.author
     question.save()
     return question
示例#6
0
 def save(self):
     q = Question(**self.cleaned_data)
     q.author = self._user
     q.save()
     return q
示例#7
0
 def save(self, author):
     question = Question(**self.cleaned_data)
     question.author = author
     question.save()
     return question
示例#8
0
 def save(self):
     ask = Question(**self.cleaned_data)
     ask.author = self._user
     ask.save()
     return ask
示例#9
0
 def save(self):
   question = Question(**self.cleaned_data)
   if self._user is not None and self._user.is_anonymous() == False:
     question.author = self._user
   question.save()
   return question
示例#10
0
文件: forms.py 项目: 8cd/task27
 def save(self):
     question = Question(**self.cleaned_data)
     question.author = self._user
     question.save()
     return question
示例#11
0
文件: forms.py 项目: kyuiva/2_6
 def save(self):
     question = Question(**self.cleaned_data)
     u = User.objects.all()[0]
     question.author = u
     question.save()
     return question
示例#12
0
文件: forms.py 项目: Megaco/web
 def save(self,user):
     # self.cleaned_data['author_id'] = 1
     post = Question(**self.cleaned_data)
     post.author=user
     post.save()
     return post