처럼 내 model.py이 모습입니다 :하나의 모델에 동일한 객체의 여러 인스턴스를 저장하는 방법은 무엇입니까? 여기
class Person(models.Model):
person_name = models.CharField(max_length=50)
owned_items = models.ForeignField("Item")
class Item(models.Model):
item_name = models.CharField(max_length=50)
item_description = models.TextField()
이 내가
item1 = Item(item_name="keyboard", item_description="computer keyboard)
item2 = Item(item_name="monitor", item_description="used to visualize data")
저장하고자하는 데이터가 내 person
모두 item1
및 item2
소유,하지만 난 방법을 잘 모르겠습니다 저장하려면
person = Person(person_name="John Smith", owned_items= ???????)