I have a model called ‘Column’ that has a relationship with my ‘Type’ model. I want to loop the ‘Column’ model by 30 in the form. Instead of showing 2 fields in the form, I want to show 30 fields in the column form and save them in the database. How can I do this?
class Type(models.Model): TYPE_OF_DATA = ( ('Number', 'Number'), ('character', 'character'), ('check_box', 'check_box'), ('date', 'date'), ('image', 'image'), ) data_type = models.CharField(max_length=1000, choices= TYPE_OF_DATA) class Column(models.Model): name = models.CharField(max_length=100) selec_type = models.ForeignKey(Type, on_delete= models.CASCADE)