summaryrefslogtreecommitdiff
path: root/tests/admin_changelist/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/admin_changelist/models.py
parent87d55081ea398c65b2503d22ed3907a9175ec729 (diff)
downloaddjango-c2e70f02653519db3a49cd48f5158ccad7434d25.tar.gz
Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField
Diffstat (limited to 'tests/admin_changelist/models.py')
-rw-r--r--tests/admin_changelist/models.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/admin_changelist/models.py b/tests/admin_changelist/models.py
index aa4241c4d3..fb5f03cbd6 100644
--- a/tests/admin_changelist/models.py
+++ b/tests/admin_changelist/models.py
@@ -12,7 +12,7 @@ class Parent(models.Model):
class Child(models.Model):
- parent = models.ForeignKey(Parent, editable=False, null=True)
+ parent = models.ForeignKey(Parent, models.SET_NULL, editable=False, null=True)
name = models.CharField(max_length=30, blank=True)
age = models.IntegerField(null=True, blank=True)
@@ -46,12 +46,12 @@ class Group(models.Model):
class Concert(models.Model):
name = models.CharField(max_length=30)
- group = models.ForeignKey(Group)
+ group = models.ForeignKey(Group, models.CASCADE)
class Membership(models.Model):
- music = models.ForeignKey(Musician)
- group = models.ForeignKey(Group)
+ music = models.ForeignKey(Musician, models.CASCADE)
+ group = models.ForeignKey(Group, models.CASCADE)
role = models.CharField(max_length=15)
@@ -69,8 +69,8 @@ class ChordsBand(models.Model):
class Invitation(models.Model):
- player = models.ForeignKey(ChordsMusician)
- band = models.ForeignKey(ChordsBand)
+ player = models.ForeignKey(ChordsMusician, models.CASCADE)
+ band = models.ForeignKey(ChordsBand, models.CASCADE)
instrument = models.CharField(max_length=15)
@@ -84,7 +84,7 @@ class Swallow(models.Model):
class SwallowOneToOne(models.Model):
- swallow = models.OneToOneField(Swallow)
+ swallow = models.OneToOneField(Swallow, models.CASCADE)
class UnorderedObject(models.Model):