Answers for "onetomany field"

0

onetomany field

You should use ForeignKey:
from django.db import models

class Car(models.Model):
    manufacturer = models.ForeignKey(
        'Manufacturer',
        on_delete=models.CASCADE,
    )
Posted by: Guest on October-25-2021

Python Answers by Framework

Browse Popular Code Answers by Language