0
장고에서 개발 중이며 일부 데이터를 편집하기 위해 양식을 만들려고합니다.Django OneToOneField가 선택되지 않았습니다.
class Jewel(models.Model):
...
goldColor = models.ForeignKey(GoldColor, related_name='jewels')
bound = models.OneToOneField('self', blank=True, null=True)
...
내 양식 :
여기 내 모델이다 나는이 datas를 편집 할 때
class JewelsManagementForm(forms.Form):
goldColor = forms.ModelChoiceField(label=LABEL_GOLD_COLOR, queryset=GoldColor.objects.all(), widget=forms.Select())
bound = forms.ModelChoiceField(label=LABEL_BOUND, queryset=Reference.objects.all(), widget=forms.Select(), required=False)
...
그러나, goldColor 필드가 올바르게 이전 값으로 할당되지만 바운드가 없습니다. 올바르게 수행 할 수있는 방법이 있습니까? 다른 필드 유형을 사용해야합니까?