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
def save(self): question = Question(**self.cleaned_data) question.added_at = datetime.now() question.rating = 0 question.author = self._user question.save() return question
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
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
def save(self): q = Question(**self.cleaned_data) q.author = self._user q.save() return q
def save(self, author): question = Question(**self.cleaned_data) question.author = author question.save() return question
def save(self): ask = Question(**self.cleaned_data) ask.author = self._user ask.save() return ask
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
def save(self): question = Question(**self.cleaned_data) u = User.objects.all()[0] question.author = u question.save() return question
def save(self,user): # self.cleaned_data['author_id'] = 1 post = Question(**self.cleaned_data) post.author=user post.save() return post