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:
parent
991efa8d08
commit
c6fa603a93
8 changed files with 112 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue