-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Implemented sorting of ReallyUserFriendlyTypes using unidecode
#93
Conversation
@rohnsha0 thanks for creating this Pull Request and helping to improve Plone! TL;DR: Finish pushing changes, pass all other checks, then paste a comment:
To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically. Happy hacking! |
+1 for sane sorting. But: I vote against using the There is pyUCA which works in a similar way but without having this problem. What do you think? |
+1 However, Proposal:
|
@zopyx then according to you, we first need to check if |
And if the unidecode package is used: >>> from unidecode import unidecode
>>> unidecode("Águia").lower()
'aguia' |
It is a dependency of the Plone universe anyway. |
then performing the sorting using |
The You must use the >>> from unidecode import unidecode
>>> list = ['Café', 'Águia', 'Água']
>>> list.sort(key=lambda string: unidecode(string).lower())
>>> list
['Água', 'Águia', 'Café'] |
Anyway, I think it's worth putting it as a dependency in |
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.
Please check for test errors.
it was the error found in one of failing test |
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
@jenkins-plone-org please run jobs |
unidecode
@jenkins-plone-org please run jobs |
@jenkins-plone-org please run jobs |
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.
+1
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.
LGTM
as discussed in plone/Products.CMFPlone#3985 (comment)