Q:

Django: select a instance of a parent model at ModelForm

I'd like to select a instance of a parent model, product, at the create.html , then send the data to views.py . However, I cannot figure out how to do that. I've achieved to select product instance at create.html as following, but I am not sure how to send the data to views.py and save it.
{% for product in products %}
  <option value="{{ product.id }}">{{ product.name}}</option>
  <div class="error">{{ form.product.id.errors }}</div>
{% endfor %}

create.html
~~~  
<div>  
  <select>
    {% for product in products %}
      <option value="{{ product.id }}">{{ product.name}}</option>
      <div class="error">{{ form.product.id.errors }}</div>
    {% endfor %}
  </select>
</div>
<div>
  <label for="invoice_no">INOVICE NO:</label>
    {{ form.invoice_no }}
  <div class="error">{{ form.invoice_no.errors }}</div>
</div>
~~~

views.py
from django.shortcuts import redirect, render
from django.http import HttpResponse
from .models import Invoice
from account.models import User
from .forms import InvoiceForm

def index(request):
    d = {
        'invoices' : Invoice.objects.all(),
    }
    return render(request, 'invoice/index.html', d)

def create(request):
    user = request.user
    if request.method == 'POST':
        form = InvoiceForm(request.POST)
        if form.is_valid():
            invoice = form.save(commit=False)
            invoice.user = user
            invoice.save()
            return redirect('/invoice')
        else:
            return redirect('/')
    else:
        products = user.products.all()
        form = InvoiceForm()
        return render(request, 'invoice/create.html', {'form': form, 'products':products})

models.py
from django.db import models

from account.models import User
from product.models import Product

class Invoice(models.Model):
    user = models.ForeignKey(User, verbose_name='User', related_name='invoices', default=1, null=True)
    product = models.ForeignKey(Product, verbose_name='Product', related_name='invoices', default=1, null=True)
    invoice_no = models.IntegerField('Invoice No')

forms.py
from django import forms
from .models import Invoice
from product.models import Product

class InvoiceForm(forms.ModelForm):
    class Meta:
        model = Invoice
        fields = (
            'product',
            'invoice_no',
        )

        widgets = {
            'product': forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Product'}),
            'invoice_no': forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Invoice No'}),

        }

A:

I've just solved. By adding name="product", I've achieved it. Thank you for your cooperation! 
  <select>
    {% for product in products %}
      <option value="{{ product.id }}">{{ product.name}}</option>
      <div class="error">{{ form.product.id.errors }}</div>
    {% endfor %}
  </select>

  <select name="product">
    {% for product in products %}
      <option value="{{ product.id }}">{{ product.name}}</option>
      <div class="error">{{ form.product.id.errors }}</div>
    {% endfor %}
  </select>

