creating a django form in formset dynamically like inline forms in django admin with jquery
问题 I have a two models Publisher and Book like below models.py class Publisher(models.Model): name = models.CharField(max_length=255) class Book(models.model): name = models.CharField(max_length=255) price = models.DecimalField() generic = generic.GenericForeignKey() publisher_id = models.PositiveIntegerField() forms.py class PublisherForm(ModelForm): model = Publisher class BookForm(ModelForm): model = Book exclude = ('generic', 'publisher_id',) def __init__(self, *args, **kwargs): super