class ProductQuantity(models.Model):
    product = models.ForeignKey('Product')
invoice = models.ForeignKey('Invoice')
quantity = models.IntegerField()


class Invoice(models.Model):
    pass
Inline editing of ManyToMany relation in Django