我在Django中有以下模型:
class Profile(models.Model):
name = models.CharField(max_length=100)
address = models.ManyToManyField(Address, symmetric=False)
def __unicode__(self):
return self.name
class Address(models.Model):
address= models.TextField()
def __unicode__(self):
return self.address
和模型形式:
class ProfileForm(ModelForm):
class Meta:
model = Profile
fields='__all__'
个人资料可以有多个地址,即用户应该能够以一种形式添加多个地址。我该如何实现?
name: _______________
address: ______________
address: ______________
address: ______________