Merge lp:~yann-papouin/ocb-addons/6.1-bug-1267845-product-and-category-search-improved-usability into lp:ocb-addons/6.1
Proposed by
Yann Papouin
Status: | Needs review |
---|---|
Proposed branch: | lp:~yann-papouin/ocb-addons/6.1-bug-1267845-product-and-category-search-improved-usability |
Merge into: | lp:ocb-addons/6.1 |
Diff against target: |
91 lines (+50/-3) 1 file modified
product/product.py (+50/-3) |
To merge this branch: | bzr merge lp:~yann-papouin/ocb-addons/6.1-bug-1267845-product-and-category-search-improved-usability |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Holger Brunn (Therp) | Needs Information | ||
Review via email: mp+201192@code.launchpad.net |
To post a comment you must log in.
Unmerged revisions
- 6830. By Yann Papouin
-
More generic regex for product name_search
Extended search based on name added if limit is not reached
Reorder if extended_ids is not empty - 6829. By Yann Papouin
-
Simpler strip for product name_search
- 6828. By Yann Papouin
-
Check category_names length before accessing by index
Simpler strip
classic_ids are not duplicates of ids anymore
Reorder only if classic_ids if not empty - 6827. By Yann Papouin
-
Trim extra characters when searching for product and product categories for better usability
18: add spaces between operators
21: this seems to be one line too much
33: that's not safe against searching for ' / ' or the like, I'd wrap that into an
if category_names:
33, 36: shouldn't strip(product_ category_ separator + ' ') be enough? (the space just to be safe if we ever change product_ category_ separator)
42: if ids and classic_ids are nondistinct sets and there's a limit, you'll get less than limit ids, which is particularly annoying for name_search. I think you should pass limit+len(ids), remove duplicates in a manner that preserves class_ids' order and then shorten it as necessary
53: why is this necessary? And if so, why only if name is set?
63: can't you integrate that in the regex above? If you'll only have '[bla' trigger searching for the default code, but not 'bla]', adding a '?' after the closing square bracket would be enough. (and I can't really think of a use case for 'bla]').
64: if you don't agree with 63, .strip('[] ') should be enough here