Skip to content

feat: add unique URLs for Artwork, Marker, Object, and Exhibit#957

Open
vjpixel wants to merge 1 commit into
developfrom
claude/scan-repo-bugs-35wDb
Open

feat: add unique URLs for Artwork, Marker, Object, and Exhibit#957
vjpixel wants to merge 1 commit into
developfrom
claude/scan-repo-bugs-35wDb

Conversation

@vjpixel

@vjpixel vjpixel commented Jun 21, 2026

Copy link
Copy Markdown
Member
  • Add slug fields (unique, auto-generated) to Marker, Object, and Artwork models
  • Add save() method to auto-generate slugs from titles with collision handling
  • Add get_absolute_url() to Marker, Object, Artwork, and Exhibit models
  • Add detail views: marker_detail, object_detail, artwork_detail
  • Register URL patterns: markers//, objects//, artworks//
  • Create Jinja2 templates for marker_detail, object_detail, artwork_detail
  • Add migration 0028 to add slug fields to marker, object, and artwork tables

- Add slug fields (unique, auto-generated) to Marker, Object, and Artwork models
- Add save() method to auto-generate slugs from titles with collision handling
- Add get_absolute_url() to Marker, Object, Artwork, and Exhibit models
- Add detail views: marker_detail, object_detail, artwork_detail
- Register URL patterns: markers/<slug>/, objects/<slug>/, artworks/<slug>/
- Create Jinja2 templates for marker_detail, object_detail, artwork_detail
- Add migration 0028 to add slug fields to marker, object, and artwork tables
@vjpixel vjpixel requested a review from pablodiegoss June 21, 2026 13:43
@vjpixel vjpixel added the priority: low Low priority - can be addressed later label Jun 21, 2026
Comment thread src/core/models.py
Comment on lines +468 to +476
base_slug = slugify(self.title) or "artwork"
slug = base_slug
counter = 1
while Artwork.objects.filter(slug=slug).exclude(pk=self.pk).exists():
slug = f"{base_slug}-{counter}"
counter += 1
self.slug = slug
super().save(*args, **kwargs)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using this counter in a while. If it conflicts with an existing slug, use directly the ID which is unique, not a counter in a while

@pablodiegoss pablodiegoss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You added new URLs and views, but there is no button anywhere on the site that takes to that URL you defined as the slug, you will have to guess the slug generated for each marker/artwork/object and type it directly into the browser to go to your new page. It is basically hidden from every user besides you, IF you can guess what is the slug to type

@pablodiegoss

Copy link
Copy Markdown
Member

Our current "details" page are the modal pages we have when the user clicks on any content. Clicking on content opens the modal page and I'm not sure if you are trying to include this new link to replace the modal or include the new links at the modal pages to "see more details" of some content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: low Low priority - can be addressed later

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants