title: Django CreateView : Append ForeignKey to CustomForm Data
body: <p>I have a CreateView as follows:</p>
  
  <pre><code>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.candidate = candidate
          self.object.save()
          f = self.request.FILES.get('file')
          data = [{
              'title': self.request['title'],
              'name': f.name,
          }]  
          response = JSONResponse(data, {}, response_mimetype(self.request))
          response['Content-Disposition'] = 'inline; filename=files.json'
          return response
  </code></pre>
  
  <p>here i am trying to append the <code>candidate</code> instance to the <code>Resume</code> models candidate field which is a <code>ForeignKey</code> to the <code>Candidate</code> model.</p>
  
  <p>But i always receive validation error <code>{'candidate' : 'This field is required'}</code> </p>
  
  <ul>
  <li>I am using a custom form not a model form as it uses twitter bootstrap identifiers.</li>
  </ul>
  
  <p>what am i missing ?</p>