title: Django: How to display foreign key objects of a model in manual form field as choices
body: <p>So I have 2 models called Billing and Organization as shown below. Billing in the admin site works as expected i.e the organization field shows all organizations listed and gives me an option to pick one. If I implement a model form for Billing it doesn't display all organizations that I can pick from. How to Implement this? I have shared forms.py, views.py code below.</p>
  
  <p><strong>models.py</strong></p>
  
  <pre class="lang-py prettyprint-override"><code>class Organization(models.Model):
      name = models.CharField(max_length=255, unique=True)
      user = models.ForeignKey(User, on_delete=models.CASCADE)
  
      def __str__(self):
          return str(self.name)
  
  
  
  class Billing(models.Model):
      invoice_name = models.CharField(max_length=50)
      organization = models.ForeignKey(Organization, on_delete=models.CASCADE)
      timestamp = models.DateTimeField(auto_now_add=True)
      product = models.ManyToManyField(Product)
  
      def __str__(self):
          return str(self.invoice_name)
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <pre class="lang-py prettyprint-override"><code>class BillingCreateView(AdminStaffRequiredMixin, SuccessMessageMixin, CreateView):
      model = Billing
      form_class = forms.BillingCreateForm
      template_name = 'dashboard/billing_new.html'
      success_message = 'Invoice has been created successfully!'
  
      def form_valid(self, form):
          form.instance.user = self.request.user
          return super().form_valid(form)
  </code></pre>
  
  <p><strong>dashboard/billing_new.html</strong></p>
  
  <pre><code>&lt;!-- start form --&gt;
                  &lt;div class="col-lg-12"&gt;
                          &lt;form method="post" action="{% url 'product_create' %}" class="mailform off2" enctype="multipart/form-data"&gt;
                              &lt;div class="row"&gt;
                                  {% csrf_token %}
                                  &lt;div class="col-md-6 offset-md-3"&gt;
                                      {{ form.invoice_name }}
                                  &lt;/div&gt;
                                  &lt;div class="col-md-6 offset-md-3"&gt;
                                      {{ form.organization }}
                                  &lt;/div&gt;
                                  &lt;div class="col-md-6 offset-md-3"&gt;
                                      {{ form.product }}
                                  &lt;/div&gt;
                                  {% if redirect_field_value %}
                                  &lt;input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" /&gt;
                                  {% endif %}
                                  &lt;div class="mfControls col-md-12 offset-md-3 text-left mt-2"&gt;
                                      &lt;button type="submit" class="btn white"&gt;{% trans "CREATE" %}&lt;/button&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/form&gt;
                  &lt;/div&gt;
                  &lt;!-- end form --&gt;
  </code></pre>
  
  <p><strong>forms.py</strong></p>
  
  <pre class="lang-py prettyprint-override"><code>class BillingCreateForm(forms.ModelForm):
  
  
      class Meta:
          model = models.Billing
          fields = ['invoice_name', 'organization', 'product']
          widgets = {
              'invoice_name': forms.TextInput(attrs={'type': 'text', 'name': 'name', 'placeholder': 'Invoice Name:'}),
              'organization': forms.TextInput(attrs={'type': 'text', 'name': 'name', 'placeholder': 'Company:'}),
              'items': forms.TextInput(attrs={'type': 'text', 'name': 'name', 'placeholder': 'Items:'}),
          }
  </code></pre>