📜  onetomany 字段 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:33.282000             🧑  作者: Mango

代码示例1
You should use ForeignKey:
from django.db import models

class Car(models.Model):
    manufacturer = models.ForeignKey(
        'Manufacturer',
        on_delete=models.CASCADE,
    )