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/custom_columns | |
parent | 87d55081ea398c65b2503d22ed3907a9175ec729 (diff) | |
download | django-c2e70f02653519db3a49cd48f5158ccad7434d25.tar.gz |
Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField
Diffstat (limited to 'tests/custom_columns')
-rw-r--r-- | tests/custom_columns/models.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/custom_columns/models.py b/tests/custom_columns/models.py index a3e8b614aa..3f619a7f04 100644 --- a/tests/custom_columns/models.py +++ b/tests/custom_columns/models.py @@ -40,7 +40,13 @@ class Article(models.Model): Article_ID = models.AutoField(primary_key=True, db_column='Article ID') headline = models.CharField(max_length=100) authors = models.ManyToManyField(Author, db_table='my_m2m_table') - primary_author = models.ForeignKey(Author, db_column='Author ID', related_name='primary_set', null=True) + primary_author = models.ForeignKey( + Author, + models.SET_NULL, + db_column='Author ID', + related_name='primary_set', + null=True, + ) def __str__(self): return self.headline |