Better Handling of Multiple Lookup Fields
With support for multiple lookup fields there are some improvements that could probably be made in the ModelLookup. For instance if you are looking up a User based on first name and last name and search "John Doe" you won't find them because it searches for users with the first name "John Doe" or last name "John Doe" which is clearly not the desired behavior. How to tokenize the search term (in this case we want it by spaces) and how to combine the terms (OR vs AND) will likely need to be configurable.
- Bitbucket: https://bitbucket.org/mlavin/django-selectable/issue/57
- Originally Reported By: Mark Lavin
- Originally Created At: 2012-06-02T03:33:47.699
0.7 is focusing on client side changes (and there a lot) so this is getting bumped.
Original Comment By: Mark Lavin
Ah yes, shlex.split looks like it will make the search even more useful.
Original Comment By: Simeon Walker
Thanks @simbloke! This looks pretty good. I might change this to use shlex.split so that quoted terms are not split.
Original Comment By: Mark Lavin
I recently came across this whilst using selectable to so a person lookup. I solved it by using the basic query from grappelli, see attachment.
Original Comment By: Simeon Walker
Are there a documentation to handling of multiple lookup fields?