title: Django ModelForm with ModelChoiceField and Query Filter
body: <p>I need to create a list of cases in dropdown list from data passed into the form for the individual firm.</p>
  
  <p>I pass the id into the form, but how do I use it in the CaseChoiceField query?</p>
  
  <p>Just using id or self.id in the query does not work.</p>
  
  <p>First in the view:</p>
  
  <pre><code>form = NewProjectCaseForm ( id = f.id )
  </code></pre>
  
  <p>The model form:</p>
  
  <pre><code>class NewProjectCaseForm ( forms.Form ):
  
      # get all the cases for the firm
      # how do I get the ID from below ???
  
      case = CaseChoiceField ( queryset = Case.objects.filter (firm_id = id ) )
  
      def __init__ ( self, *args, **kwargs ):
  
          # id from the view
          self.id = kwargs.pop ( 'id' )
  
          super ( NewProjectCaseForm, self ).__init__ ( *args, **kwargs )
          self.helper = FormHelper ()
          self.helper.layout = Layout (
  
          Div (
              Div ( 'case', css_class = 'large-10 cell' ),
              css_class = 'grid-x'
          ),
  
          ButtonHolder (
              Submit ( 'submit', 'Add Case', css_class = 'button small-6' )
          )
      )
  </code></pre>
  
  <p>to create the dropdown I use this: </p>
  
  <pre><code>class CaseChoiceField ( ModelChoiceField ):
  
      def label_from_instance ( self, obj ):
          return '{} - {}'.format ( obj.name, obj.firm )
  </code></pre>
  
  <p>I am using Crispy forms (for Foundation)</p>
  
  <p>I hope this makes sense.</p>
  
  <p>Thank you very much.</p>