Cannot assign "25": "Box.image" must be a "Image" instance.

2021. 1. 31. 19:01파이썬/Django

Model의 ForeignKey는 값이 아닌, 객체를 대입해야 함

        self.image = image(X)
        self.image = Image.objects.get(id=image)(O)

'파이썬 > Django' 카테고리의 다른 글

Djang Admin widget 셋팅  (0) 2021.02.04
Django Model ForeignKey  (0) 2021.01.31
object has no attribute '_state'  (0) 2021.01.31
Django __init__() takes 1 positional argument but 2 were given  (0) 2021.01.31
Django Model에 instance 추가  (0) 2021.01.31