SourceTerms ignores ordering from the ITerms vocabulary
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
z3c.form |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
in z3c.form.term, this code:
class SourceTerms(Terms):
"""Base implementation for ITerms using a source instead of a vocabulary."""
...
def __iter__(self):
for value in self.source:
yield self.terms.
Uses the ordering from the source rather than the ITerms adapter. Since the source has no access to the request, the terms cannot be sorted in a request-sensitive way. i.e. you cannot take into account translations when sorting.
I believe that the __iter__ method of SourceTerms should just be removed allowing the ITerms adapter to do the sorting. The ITerms interface does require an __iter__ method.
I'll commit on a patch+tests for this if I get a +1 or no-one objects for a while.
Sounds good. Feel free to commit the patch.