title: Django UpdateView misses queryset
body: <p>I can't figure out, what is wrong with my code. I tried so much stuff and my createview is working. But there I use the flight and not the gatehandling as pk.</p>
  
  <p>For me this seems okay, and I dont understand why the console tells me that querysets are missing.</p>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>class Airport(models.Model):
      name = models.CharField(max_length=255, unique=True)
  
  class Flight(models.Model):
      start = models.ForeignKey(Airport, on_delete=models.CASCADE,
          related_name='start')
      end = models.ForeignKey(Airport, on_delete=models.CASCADE,
          related_name='end')
      number = models.CharField(max_length=5, default="EJT12")
  
  class Gate(models.Model):
      airport = models.ForeignKey(Airport, on_delete=models.CASCADE)
      number = models.IntegerField(default=0)
  
  class GateHandling(models.Model):
      gate = models.ForeignKey(Gate, on_delete=models.CASCADE)
      flight = models.ForeignKey(Flight, on_delete=models.CASCADE)
  </code></pre>
  
  <p><strong>urls.py</strong></p>
  
  <pre><code>path('gate-handling/&lt;int:pk&gt;/update', views.GateHandlingUpdate.as_view(), name='gate_handling_update'),
  </code></pre>
  
  <p><strong>detail.html</strong></p>
  
  <pre><code>{% for flight in flights_arriving %}
      {% for gate_handling in flight.gatehandling_set.all %}
        &lt;p&gt;{{gate_handling}} &lt;a href="{% url 'management:gate_handling_update' gate_handling.pk %}"&gt;Change&lt;/a&gt;&lt;/p&gt;
      {% empty %}
        &lt;p&gt;Gate &lt;a href="{% url 'management:gate_handling_create' flight.pk %}"&gt;Assign&lt;/a&gt;&lt;/p&gt;
      {% endfor %}
  {% endfor %}
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>class GateHandlingUpdate(UpdateView):
      form_class = GateHandlingUpdateForm
      template_name = 'management/gatehandling_update.html'
  
      def get_form_kwargs(self):
          kwargs = super().get_form_kwargs()
          kwargs['airport'] = Gate.objects.get(gatehandling=self.object).airport
          kwargs['flight'] = Flight.objects.get(pk=self.object.flight.pk)
          return kwargs
  </code></pre>
  
  <p><strong>forms.py</strong></p>
  
  <pre><code>class GateHandlingUpdateForm(ModelForm):
      class Meta:
          model = GateHandling
          fields = ['gate', 'flight']
  
      def __init__(self, *args, **kwargs):
          airport = kwargs.pop('airport')
          flight = kwargs.pop('flight')
          super().__init__(*args, **kwargs)
          self.fields['flight'].queryset = Flight.objects.filter(pk=flight.pk)
          self.fields['gate'].queryset = Gate.objects.filter(airport=airport)
  </code></pre>
  
  <p><strong>console</strong></p>
  
  <pre><code>Internal Server Error: /gate-handling/9/update
  Traceback (most recent call last):
    File "D:\airport\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
      response = get_response(request)
    File "D:\airport\venv\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response
      response = self.process_exception_by_middleware(e, request)
    File "D:\airport\venv\lib\site-packages\django\core\handlers\base.py", line 124, in _get_response
      response = wrapped_callback(request, *callback_args, **callback_kwargs)
    File "D:\airport\venv\lib\site-packages\django\views\generic\base.py", line 68, in view
      return self.dispatch(request, *args, **kwargs)
    File "D:\airport\venv\lib\site-packages\django\views\generic\base.py", line 88, in dispatch
      return handler(request, *args, **kwargs)
    File "D:\airport\venv\lib\site-packages\django\views\generic\edit.py", line 189, in get
      self.object = self.get_object()
    File "D:\airport\venv\lib\site-packages\django\views\generic\detail.py", line 30, in get_object
      queryset = self.get_queryset()
    File "D:\airport\venv\lib\site-packages\django\views\generic\detail.py", line 73, in get_queryset
      'cls': self.__class__.__name__
  django.core.exceptions.ImproperlyConfigured: GateHandlingUpdate is missing a QuerySet. Define GateHandlingUpdate.model, GateHandlingUpdate.queryset, or override GateHandlingUpdate.get_queryset().
  [09/Dec/2018 13:35:45] "GET /gate-handling/9/update HTTP/1.1" 500 82521
  Not Found: /favicon.ico
  [09/Dec/2018 13:35:45] "GET /favicon.ico HTTP/1.1" 404 2965
  </code></pre>