Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to rename a tag #463

Merged
merged 4 commits into from
Jul 9, 2024
Merged

Add the ability to rename a tag #463

merged 4 commits into from
Jul 9, 2024

Conversation

simonw
Copy link
Owner

@simonw simonw commented Jul 9, 2024

Add the ability to rename a tag and create a PreviousTagName object recording the previous name.

  • Add PreviousTagName model in blog/models.py.
  • Add rename_tag method to Tag model in blog/models.py to handle renaming and create PreviousTagName objects.
  • Update TagAdmin in blog/admin.py to handle renaming and create PreviousTagName objects.
  • Add migration for PreviousTagName model in blog/migrations/0021_previous_tag_name.py.
  • Add tests for renaming a tag and creating PreviousTagName object in blog/tests.py.
  • Add tests to ensure tags can contain hyphens in blog/tests.py.

For more details, open the Copilot Workspace session.

@simonw simonw merged commit be50da8 into main Jul 9, 2024
2 checks passed
@simonw simonw deleted the add-rename-tag branch July 9, 2024 22:22
@simonw
Copy link
Owner Author

simonw commented Jul 9, 2024

Renamed a ton of tags: https://simonwillison.net/admin/blog/previoustagname/

CleanShot 2024-07-09 at 15 52 18@2x

simonw added a commit to simonw/simonwillisonblog-backup that referenced this pull request Jul 9, 2024
@simonw
Copy link
Owner Author

simonw commented Jul 9, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant