0
我在同一個頁面上把這些模型的形式(通過的ModelForm),但類似的字段名稱已經取得了一些問題,對我來說:具有相同的頁面有些ModelForms有一些類似的字段名稱
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)
我用Google搜索並剛剛發現關於formset,我該如何解決這個問題?