summaryrefslogtreecommitdiff
path: root/tests/modeladmin/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/modeladmin/models.py')
-rw-r--r--tests/modeladmin/models.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/modeladmin/models.py b/tests/modeladmin/models.py
index 8457e60876..8f69b42874 100644
--- a/tests/modeladmin/models.py
+++ b/tests/modeladmin/models.py
@@ -18,8 +18,8 @@ class Band(models.Model):
class Concert(models.Model):
- main_band = models.ForeignKey(Band, related_name='main_concerts')
- opening_band = models.ForeignKey(Band, related_name='opening_concerts',
+ main_band = models.ForeignKey(Band, models.CASCADE, related_name='main_concerts')
+ opening_band = models.ForeignKey(Band, models.CASCADE, related_name='opening_concerts',
blank=True)
day = models.CharField(max_length=3, choices=((1, 'Fri'), (2, 'Sat')))
transport = models.CharField(max_length=100, choices=(
@@ -36,7 +36,7 @@ class ValidationTestModel(models.Model):
state = models.CharField(max_length=2, choices=(("CO", "Colorado"), ("WA", "Washington")))
is_active = models.BooleanField(default=False)
pub_date = models.DateTimeField()
- band = models.ForeignKey(Band)
+ band = models.ForeignKey(Band, models.CASCADE)
no = models.IntegerField(verbose_name="Number", blank=True, null=True) # This field is intentionally 2 characters long. See #16080.
def decade_published_in(self):
@@ -44,4 +44,4 @@ class ValidationTestModel(models.Model):
class ValidationTestInlineModel(models.Model):
- parent = models.ForeignKey(ValidationTestModel)
+ parent = models.ForeignKey(ValidationTestModel, models.CASCADE)