我是编写 Django 模型的新手。我想要一个 Person 模型,每个人都有不同数量的职位。
from django.db import models
class Person(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
positions = models.ForeignKey('Position')
class Position(models.Model):
person = models.ForeignKey(Person)
company = models.CharField(max_length=200)
summary = models.TextField()
start_date = models.DateField()
end_date = models.DateField()
currently_there = models.BooleanField()
如何设置它以便一个人可以有多个职位?