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/annotations | |
| parent | 87d55081ea398c65b2503d22ed3907a9175ec729 (diff) | |
Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField
Diffstat (limited to 'tests/annotations')
| -rw-r--r-- | tests/annotations/models.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/annotations/models.py b/tests/annotations/models.py index 954c8ad339..1c6faaf884 100644 --- a/tests/annotations/models.py +++ b/tests/annotations/models.py @@ -30,8 +30,8 @@ class Book(models.Model): rating = models.FloatField() price = models.DecimalField(decimal_places=2, max_digits=6) authors = models.ManyToManyField(Author) - contact = models.ForeignKey(Author, related_name='book_contact_set') - publisher = models.ForeignKey(Publisher) + contact = models.ForeignKey(Author, models.CASCADE, related_name='book_contact_set') + publisher = models.ForeignKey(Publisher, models.CASCADE) pubdate = models.DateField() def __str__(self): @@ -65,7 +65,7 @@ class Employee(models.Model): first_name = models.CharField(max_length=20) manager = models.BooleanField(default=False) last_name = models.CharField(max_length=20) - store = models.ForeignKey(Store) + store = models.ForeignKey(Store, models.CASCADE) age = models.IntegerField() salary = models.DecimalField(max_digits=8, decimal_places=2) |
