diff user_photos/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 b6e98717690b
children
line wrap: on
line diff
--- a/user_photos/models.py	Sat Jan 04 21:34:31 2025 -0600
+++ b/user_photos/models.py	Wed Jan 22 17:58:16 2025 -0600
@@ -10,7 +10,8 @@
 class Photo(models.Model):
     """This model represents data about a user uploaded photo."""
     user = models.ForeignKey(settings.AUTH_USER_MODEL,
-                             related_name='uploaded_photos')
+                             related_name='uploaded_photos',
+                             on_delete=models.CASCADE)
     upload_date = models.DateTimeField()
     url = models.URLField(max_length=200)
     thumb_url = models.URLField(max_length=200, blank=True)