diff news/models.py @ 1206:02181fa5ac9d modernize tip

Update to Django 1.9.
author Brian Neal <bgneal@gmail.com>
date Wed, 22 Jan 2025 17:58:16 -0600
parents 9fc12bbc8c81
children
line wrap: on
line diff
--- a/news/models.py	Sat Jan 04 21:34:31 2025 -0600
+++ b/news/models.py	Wed Jan 22 17:58:16 2025 -0600
@@ -42,8 +42,8 @@
 class StoryBase(models.Model):
     """Abstract model to collect common fields."""
     title = models.CharField(max_length=255)
-    submitter = models.ForeignKey(User)
-    category = models.ForeignKey(Category)
+    submitter = models.ForeignKey(User, on_delete=models.CASCADE)
+    category = models.ForeignKey(Category, on_delete=models.CASCADE)
     short_text = models.TextField(default='', blank=True)
     long_text = models.TextField(default='', blank=True)
     date_submitted = models.DateTimeField(db_index=True)