summaryrefslogtreecommitdiff
path: root/tests/null_fk/models.py
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/models.py
parent87d55081ea398c65b2503d22ed3907a9175ec729 (diff)
Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField
Diffstat (limited to 'tests/null_fk/models.py')
-rw-r--r--tests/null_fk/models.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/null_fk/models.py b/tests/null_fk/models.py
index 9309ae940f..6a7da8f620 100644
--- a/tests/null_fk/models.py
+++ b/tests/null_fk/models.py
@@ -11,18 +11,18 @@ class SystemDetails(models.Model):
class SystemInfo(models.Model):
- system_details = models.ForeignKey(SystemDetails)
+ system_details = models.ForeignKey(SystemDetails, models.CASCADE)
system_name = models.CharField(max_length=32)
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):
@@ -31,7 +31,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:
@@ -52,6 +52,6 @@ class PropertyValue(models.Model):
class Property(models.Model):
- item = models.ForeignKey(Item, related_name='props')
+ item = models.ForeignKey(Item, models.CASCADE, related_name='props')
key = models.CharField(max_length=100)
- value = models.ForeignKey(PropertyValue, null=True)
+ value = models.ForeignKey(PropertyValue, models.SET_NULL, null=True)