Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django foreign key field on delete do nothing

from django.db import models

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

class Manufacturer(models.Model):
    pass
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #django #foreign #key #field #delete
ADD COMMENT
Topic
Name
9+8 =