summaryrefslogtreecommitdiff
path: root/tests/null_fk_ordering
diff options
context:
space:
mode:
authorFlavio Curella <flavio.curella@gmail.com>2015-07-22 09:43:21 -0500
committerTim Graham <timograham@gmail.com>2015-07-27 18:28:13 -0400
commitc2e70f02653519db3a49cd48f5158ccad7434d25 (patch)
treec0f421a6b0c26a7716c380b3e360fecc74d553fb /tests/null_fk_ordering
parent87d55081ea398c65b2503d22ed3907a9175ec729 (diff)
downloaddjango-c2e70f02653519db3a49cd48f5158ccad7434d25.tar.gz
Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField
Diffstat (limited to 'tests/null_fk_ordering')
-rw-r--r--tests/null_fk_ordering/models.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/null_fk_ordering/models.py b/tests/null_fk_ordering/models.py
index dac1c4f6ae..b5d59eca0f 100644
--- a/tests/null_fk_ordering/models.py
+++ b/tests/null_fk_ordering/models.py
@@ -19,7 +19,7 @@ class Author(models.Model):
@python_2_unicode_compatible
class Article(models.Model):
title = models.CharField(max_length=150)
- author = models.ForeignKey(Author, null=True)
+ author = models.ForeignKey(Author, models.SET_NULL, null=True)
def __str__(self):
return 'Article titled: %s' % (self.title, )
@@ -34,13 +34,13 @@ class SystemInfo(models.Model):
class Forum(models.Model):
- system_info = models.ForeignKey(SystemInfo)
+ system_info = models.ForeignKey(SystemInfo, models.CASCADE)
forum_name = models.CharField(max_length=32)
@python_2_unicode_compatible
class Post(models.Model):
- forum = models.ForeignKey(Forum, null=True)
+ forum = models.ForeignKey(Forum, models.SET_NULL, null=True)
title = models.CharField(max_length=32)
def __str__(self):
@@ -49,7 +49,7 @@ class Post(models.Model):
@python_2_unicode_compatible
class Comment(models.Model):
- post = models.ForeignKey(Post, null=True)
+ post = models.ForeignKey(Post, models.SET_NULL, null=True)
comment_text = models.CharField(max_length=250)
class Meta: