summaryrefslogtreecommitdiff
path: root/tests/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/ordering
parent87d55081ea398c65b2503d22ed3907a9175ec729 (diff)
downloaddjango-c2e70f02653519db3a49cd48f5158ccad7434d25.tar.gz
Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField
Diffstat (limited to 'tests/ordering')
-rw-r--r--tests/ordering/models.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/ordering/models.py b/tests/ordering/models.py
index c588a4e418..213a8f5ce8 100644
--- a/tests/ordering/models.py
+++ b/tests/ordering/models.py
@@ -24,8 +24,8 @@ class Author(models.Model):
@python_2_unicode_compatible
class Article(models.Model):
- author = models.ForeignKey(Author, null=True)
- second_author = models.ForeignKey(Author, null=True)
+ author = models.ForeignKey(Author, models.SET_NULL, null=True)
+ second_author = models.ForeignKey(Author, models.SET_NULL, null=True)
headline = models.CharField(max_length=100)
pub_date = models.DateTimeField()
@@ -43,7 +43,7 @@ class OrderedByAuthorArticle(Article):
class Reference(models.Model):
- article = models.ForeignKey(OrderedByAuthorArticle)
+ article = models.ForeignKey(OrderedByAuthorArticle, models.CASCADE)
class Meta:
ordering = ('article',)