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

Implement viewlet dummy ordering needed for Python 3 sorting #152

Merged
merged 16 commits into from
Sep 17, 2018
Merged

Conversation

ale-rt
Copy link
Member

@ale-rt ale-rt commented May 6, 2018

No description provided.

@ale-rt
Copy link
Member Author

ale-rt commented May 12, 2018

The reason for this PR is that viewlets are sorted here:

The line brings my name, but that sorting is in place since 11 years and looks like:

# then sort the remaining ones
# Copied from Five
remaining = sorted(name_map.items(), lambda x, y: cmp(aq_base(x[1]), aq_base(y[1])))

x[1] and y[1] are viewlets instances.

It seems to me that there isn't actually a good criterion that can be used to sort that remaining viewlets (the ones that are not sorted by the IViewletSettingsStorage utility).

I think we should remove the sorted call in https://github.com/plone/plone.app.viewletmanager/blob/master/plone/app/viewletmanager/manager.py#L84
As an alternative we may provide an attribute that can be used for sorting them (order? with a default of 0?) and the __lt__ operator should check it.

@pbauer pbauer merged commit 27b0fe9 into master Sep 17, 2018
@jensens jensens deleted the python3 branch September 9, 2019 08:42
talarias pushed a commit that referenced this pull request Dec 9, 2021
Fixed missing colons in less variables
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.

3 participants