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

Allow item IDs to have periods in them #837

Merged
merged 4 commits into from
Mar 4, 2019
Merged

Conversation

rstorey
Copy link
Member

@rstorey rstorey commented Mar 4, 2019

refs #836

@rstorey rstorey self-assigned this Mar 4, 2019
@rstorey rstorey requested a review from acdha March 4, 2019 19:35
@@ -12,6 +12,7 @@
from . import converters, views

register_converter(converters.UnicodeSlugConverter, "uslug")
register_converter(converters.ItemSlugConverter, "islug")
Copy link
Member

Choose a reason for hiding this comment

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

I'd be included to give this a longer name since this is really saying that the value is something other than a slug. Maybe just go with item_id?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@@ -5,3 +5,8 @@ class UnicodeSlugConverter(SlugConverter):
# This is similar to the slug_unicode_re pattern but is not anchored to the
# start of the string:
regex = r"[-\w+]+"


class ItemSlugConverter(SlugConverter):
Copy link
Member

Choose a reason for hiding this comment

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

Since this isn't really a slug any more, maybe it should just directly subclass StringConverter and be something like ItemIdConverter?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@coveralls
Copy link

coveralls commented Mar 4, 2019

Coverage Status

Coverage increased (+0.03%) to 69.67% when pulling 1b187a9 on items-with-periods into 5b9ae23 on master.

@rstorey
Copy link
Member Author

rstorey commented Mar 4, 2019

According to Patrick, any character that can be in a URL can be in an item ID (including slashes) - except for ?.

acdha
acdha previously approved these changes Mar 4, 2019
@rstorey rstorey merged commit 52fca89 into master Mar 4, 2019
@rstorey rstorey deleted the items-with-periods branch March 11, 2019 19:25
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.

None yet

3 participants