Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField

This commit is contained in:
Flavio Curella 2015-07-22 09:43:21 -05:00 committed by Tim Graham
parent 87d55081ea
commit c2e70f0265
176 changed files with 1525 additions and 1008 deletions

View file

@ -7,7 +7,7 @@ class Person(models.Model):
class Movie(models.Model):
title = models.CharField(max_length=200)
director = models.ForeignKey(Person)
director = models.ForeignKey(Person, models.CASCADE)
class Event(models.Model):
@ -15,16 +15,16 @@ class Event(models.Model):
class Screening(Event):
movie = models.ForeignKey(Movie)
movie = models.ForeignKey(Movie, models.CASCADE)
class ScreeningNullFK(Event):
movie = models.ForeignKey(Movie, null=True)
movie = models.ForeignKey(Movie, models.SET_NULL, null=True)
class Package(models.Model):
screening = models.ForeignKey(Screening, null=True)
screening = models.ForeignKey(Screening, models.SET_NULL, null=True)
class PackageNullFK(models.Model):
screening = models.ForeignKey(ScreeningNullFK, null=True)
screening = models.ForeignKey(ScreeningNullFK, models.SET_NULL, null=True)