-
Notifications
You must be signed in to change notification settings - Fork 34
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
Conversation
concordia/urls.py
Outdated
@@ -12,6 +12,7 @@ | |||
from . import converters, views | |||
|
|||
register_converter(converters.UnicodeSlugConverter, "uslug") | |||
register_converter(converters.ItemSlugConverter, "islug") |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
concordia/converters.py
Outdated
@@ -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): |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
According to Patrick, any character that can be in a URL can be in an item ID (including slashes) - except for |
refs #836