feat: Implement initial schema and add various API, service, and management command enhancements across the application.

This commit is contained in:
pacnpal
2026-01-01 15:13:01 -05:00
parent c95f99ca10
commit b243b17af7
413 changed files with 11164 additions and 17433 deletions

View File

@@ -35,14 +35,12 @@ def ride_photo_upload_path(instance: models.Model, filename: str) -> str:
class RidePhoto(TrackedModel):
"""Photo model specific to rides."""
ride = models.ForeignKey(
"rides.Ride", on_delete=models.CASCADE, related_name="photos"
)
ride = models.ForeignKey("rides.Ride", on_delete=models.CASCADE, related_name="photos")
image = models.ForeignKey(
'django_cloudflareimages_toolkit.CloudflareImage',
"django_cloudflareimages_toolkit.CloudflareImage",
on_delete=models.CASCADE,
help_text="Ride photo stored on Cloudflare Images"
help_text="Ride photo stored on Cloudflare Images",
)
caption = models.CharField(max_length=255, blank=True)
@@ -56,7 +54,7 @@ class RidePhoto(TrackedModel):
domain="rides",
max_length=50,
default="exterior",
help_text="Type of photo for categorization and display purposes"
help_text="Type of photo for categorization and display purposes",
)
# Metadata
@@ -100,9 +98,7 @@ class RidePhoto(TrackedModel):
# Set default caption if not provided
if not self.caption and self.uploaded_by:
self.caption = MediaService.generate_default_caption(
self.uploaded_by.username
)
self.caption = MediaService.generate_default_caption(self.uploaded_by.username)
# If this is marked as primary, unmark other primary photos for this ride
if self.is_primary: