-
Notifications
You must be signed in to change notification settings - Fork 888
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 predicate values to participate in view weighting #1863
Comments
I’m interested to take this |
I've thought about this issue for a long time and I don't have a viable solution. I think it's deceivingly difficult. Definitely open to some ideas, but I think it'll require some predicate extensions that are not clear to me right now to allow a predicate to provide a local weighting value that Pyramid would then incorporate into the top-level weighting that Pyramid uses. |
The easiest thing I've got is to add some optional method to a predicate that exposes a weight between 0 and 1. Something like |
With Python 3, comparisons between different types are blocked by default, so the standard (I couldn’t say if your reference to I think my interest came from the bug I had in a custom predicate which made me think that it was not possible to have |
Yeah the feature is specifically around comparing predicate instances of the same type so definitely |
Copied from a paste in #pyramid irc:
Basically the two views have different values for their
request_param
predicate but they do not conflict and are ambiguously ordered. This strategy only works if the predicate values are mutually exclusive such that no value in one view is a subset of values in another view.We should add a new sortable attribute to predicates or use the phash itself to contribute to the weighting such that 2 views with the same predicate but different values can be sorted appropriately.
The text was updated successfully, but these errors were encountered: