Django-Form

Working with Formset

As documentation says: A formset is a layer of abstraction to work with multiple forms on the same page. It can be best compared to a data grid. So here I am going to show a very simple django formset implementation example. Here we are going to use the following model, form, template, view: Model class Product(models.Model): name = models.CharField(max_length=50) quantity = models.IntegerField() price = models.IntegerField() class Distributor(models.Model): name = models.CharField(max_length=100) products= models.ManyToManyField(Product) These fairly simple models, where…

Keep reading

Categories: Django, Django-Form, technical-blogs