我有一个CreateView如下: class ResumeCreateView(CreateView): model = Resume def form_valid(self, request, form): candidate = Candidate.objects.get(user=self.request.user) self.object = form.save(commit=False) self.object.candida
file:Capacity / models.py class Env(models.Model): name = models.CharField(max_length=50) def get_absolute_url(self): return reverse('index') class Envhosts(models.Model): env = models.ForeignKey(Env) hostname = mo
我是stackoverflow,python和Django的新手,对我在表单上单击提交时遇到的'(NOT NULL约束失败:sixerrapp_gig.user_id)’错误有疑问. 很确定这是因为我没有从StackOverflow上找到的user_id值分配到目前为止,但是我不知道如何使用django CreateView来完成它. 项目练习基于fiverr.com的