1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-19 12:59:36 +02:00

feat: add primary image functionality to AdventureImage model and update related components

This commit is contained in:
Sean Morley 2025-01-02 23:25:58 -05:00
parent 991efa8d08
commit c6fa603a93
8 changed files with 112 additions and 5 deletions

View file

@ -280,6 +280,7 @@ class AdventureImage(models.Model):
upload_to=PathAndRename('images/') # Use the callable class here
)
adventure = models.ForeignKey(Adventure, related_name='images', on_delete=models.CASCADE)
is_primary = models.BooleanField(default=False)
def __str__(self):
return self.image.url