I’ve put forms of these model(via ModelForm) at the same page but similar Field Names have made some problem for me:
class Transfer(models.Model):
ServiceProvider=models.ForeignKey(ServiceProvider)
Vehicle=models.ForeignKey(Vehicle)
From=models.ForeignKey(Location,related_name='FromLocation')
To=models.ForeignKey(Location,related_name='ToLocation')
PriceUnit=models.ForeignKey(PriceUnit)
Class=models.ForeignKey(Class)
Price=models.CharField(max_length=12)
Date=models.CharField(max_length=16)
class Visit(models.Model):
Location=models.ForeignKey(Location)
FromDate=models.CharField(max_length=16)
ToDate=models.CharField(max_length=16)
class Accommodate(models.Model):
Location=models.ForeignKey(Location)
PriceUnit=models.ForeignKey(PriceUnit)
FromDate=models.CharField(max_length=16)
ToDate=models.CharField(max_length=16)
Price=models.CharField(max_length=12)
I googled and just found about formset,How can I solve this problem?
You can pass the forms a prefix e.g.