diff options
author | Flavio Curella <flavio.curella@gmail.com> | 2015-07-22 09:43:21 -0500 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-07-27 18:28:13 -0400 |
commit | c2e70f02653519db3a49cd48f5158ccad7434d25 (patch) | |
tree | c0f421a6b0c26a7716c380b3e360fecc74d553fb /tests/admin_checks | |
parent | 87d55081ea398c65b2503d22ed3907a9175ec729 (diff) | |
download | django-c2e70f02653519db3a49cd48f5158ccad7434d25.tar.gz |
Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField
Diffstat (limited to 'tests/admin_checks')
-rw-r--r-- | tests/admin_checks/models.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/admin_checks/models.py b/tests/admin_checks/models.py index 835c26c0dc..822d695e4d 100644 --- a/tests/admin_checks/models.py +++ b/tests/admin_checks/models.py @@ -15,7 +15,7 @@ class Album(models.Model): @python_2_unicode_compatible class Song(models.Model): title = models.CharField(max_length=150) - album = models.ForeignKey(Album) + album = models.ForeignKey(Album, models.CASCADE) original_release = models.DateField(editable=False) class Meta: @@ -30,8 +30,8 @@ class Song(models.Model): class TwoAlbumFKAndAnE(models.Model): - album1 = models.ForeignKey(Album, related_name="album1_set") - album2 = models.ForeignKey(Album, related_name="album2_set") + album1 = models.ForeignKey(Album, models.CASCADE, related_name="album1_set") + album2 = models.ForeignKey(Album, models.CASCADE, related_name="album2_set") e = models.CharField(max_length=1) @@ -47,8 +47,8 @@ class Book(models.Model): class AuthorsBooks(models.Model): - author = models.ForeignKey(Author) - book = models.ForeignKey(Book) + author = models.ForeignKey(Author, models.CASCADE) + book = models.ForeignKey(Book, models.CASCADE) featured = models.BooleanField() @@ -57,12 +57,12 @@ class State(models.Model): class City(models.Model): - state = models.ForeignKey(State) + state = models.ForeignKey(State, models.CASCADE) class Influence(models.Model): name = models.TextField() - content_type = models.ForeignKey(ContentType) + content_type = models.ForeignKey(ContentType, models.CASCADE) object_id = models.PositiveIntegerField() content_object = GenericForeignKey('content_type', 'object_id') |