title: How to access field names of a ModelForm in Django?
body: <p>Just to be clear, I'm asking about accessing the fields in views.py</p>
  
  <p>I want to add extra data into the form before it is validated (because it's a required field), and <a href="https://stackoverflow.com/a/30849799/6562245">another answer</a> on stackexchange seems to imply I have to create a new form to do so.</p>
  
  <p>Right now my code look something like this:</p>
  
  <pre><code>if request.method == 'POST':
      # create a form instance and populate it with data from the request:
      form = TestForm(request.POST)
      data = {}
      for ---:
          ---add to data---
      comp = Component.objects.get(name = path)
      data['component'] = comp.id
      form = TestForm(data)
      if form.is_valid():
          test = form.save(commit = 'false')
          test.save()
          return submitTest(request, var)
  </code></pre>
  
  <p>How could I fill in the parts with dashes? </p>