# models.py
class modelA(models.Model):
a = models.CharField()
b = models.CharField()
class ModelB(models.Model):
c = models.CharField()
d = models.ForeignKey(modelA)
# forms.py
class myForm (ModelForm):
class Meta:
model = ModelB
fields = ('d')
widgets = { 'd' : TextInput() }
我想显示一个显示a
和b
字段的表单TextInput
以及如何做?
上面的forms.py
代码显示d
为名称而不是其字段..