Skip to content

Commit

Permalink
add a comment explaining the FK to BaseFile
Browse files Browse the repository at this point in the history
  • Loading branch information
tykling committed Dec 8, 2024
1 parent 901cd72 commit bb869ac
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/images/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ class ImageVersion(ImageModel, BaseModel):
help_text="The Job which triggered uploading of this image version.",
)

# This FK points to BaseFile instead of Image to make prefetching ImageVersions possible.
image = models.ForeignKey(
"files.BaseFile",
on_delete=NP_CASCADE, # delete all versions when an Image is deleted
Expand Down

0 comments on commit bb869ac

Please sign in to comment.