예제 #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
예제 #5
0
 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