diff options
| author | Flavio Curella <flavio.curella@gmail.com> | 2015-07-22 09:43:21 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-07-27 18:28:13 -0400 |
| commit | c2e70f02653519db3a49cd48f5158ccad7434d25 (patch) | |
| tree | c0f421a6b0c26a7716c380b3e360fecc74d553fb /tests/modeladmin | |
| parent | 87d55081ea398c65b2503d22ed3907a9175ec729 (diff) | |
Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField
Diffstat (limited to 'tests/modeladmin')
| -rw-r--r-- | tests/modeladmin/models.py | 8 |
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) |
