Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

onetomany field

You should use ForeignKey:
from django.db import models

class Car(models.Model):
    manufacturer = models.ForeignKey(
        'Manufacturer',
        on_delete=models.CASCADE,
    )
Source by docs.djangoproject.com #
 
PREVIOUS NEXT
Tagged: #onetomany #field
ADD COMMENT
Topic
Name
1+8 =