바뀜

746 바이트 추가됨 ,  2022년 7월 20일 (수) 11:19
새 문서: === django.core.exceptions.FieldError: Unknown field(s) (필드) specified for 모델 === 필드의 이름에 변경을 가할 때 발생하는 에러이다. 이미 다른 곳에서...
=== django.core.exceptions.FieldError: Unknown field(s) (필드) specified for 모델 ===
필드의 이름에 변경을 가할 때 발생하는 에러이다. 이미 다른 곳에서 이 모델의 필드를 참조할 때 발생한다.
{| class="wikitable"
!모델의 Meta클래스에 이미 지정되어 있거나,
!폼에서 이미 참조하고 있거나.
|-
|<syntaxhighlight lang="python">
class Meta:
unique_together = (
('board_name', 'enter_year')
)
</syntaxhighlight>
|<syntaxhighlight lang="python">
class BoardForm(forms.ModelForm):
class Meta:
model = Board
fields = ['enter_year']
</syntaxhighlight>
|}
참고한 속성명도 함께 바꾸어주어야 에러 없이 모델 필드가 변경된다.