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

@@ -22,9 +22,7 @@ def park_photo_upload_path(instance: models.Model, filename: str) -> str:
if park is None:
raise ValueError("Park cannot be None")
return MediaService.generate_upload_path(
domain="park", identifier=park.slug, filename=filename
)
return MediaService.generate_upload_path(domain="park", identifier=park.slug, filename=filename)
@pghistory.track()
@@ -39,23 +37,15 @@ class ParkPhoto(TrackedModel):
)
image = models.ForeignKey(
'django_cloudflareimages_toolkit.CloudflareImage',
"django_cloudflareimages_toolkit.CloudflareImage",
on_delete=models.CASCADE,
help_text="Park photo stored on Cloudflare Images"
help_text="Park photo stored on Cloudflare Images",
)
caption = models.CharField(
max_length=255, blank=True, help_text="Photo caption or description"
)
alt_text = models.CharField(
max_length=255, blank=True, help_text="Alternative text for accessibility"
)
is_primary = models.BooleanField(
default=False, help_text="Whether this is the primary photo for the park"
)
is_approved = models.BooleanField(
default=False, help_text="Whether this photo has been approved by moderators"
)
caption = models.CharField(max_length=255, blank=True, help_text="Photo caption or description")
alt_text = models.CharField(max_length=255, blank=True, help_text="Alternative text for accessibility")
is_primary = models.BooleanField(default=False, help_text="Whether this is the primary photo for the park")
is_approved = models.BooleanField(default=False, help_text="Whether this photo has been approved by moderators")
# Metadata
created_at = models.DateTimeField(auto_now_add=True)
@@ -100,9 +90,7 @@ class ParkPhoto(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 park
if self.is_primary: