forked from DGNum/gestioCOF
Separate the autocompletion logic form the views
This commit is contained in:
parent
fbbc9937f6
commit
9a90f19502
12 changed files with 78 additions and 82 deletions
11
shared/views.py
Normal file
11
shared/views.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
from dal import autocomplete
|
||||
|
||||
from shared.autocomplete import ModelSearch
|
||||
|
||||
|
||||
class Select2QuerySetView(ModelSearch, autocomplete.Select2QuerySetView):
|
||||
"""Compatibility layer between ModelSearch and Select2QuerySetView."""
|
||||
|
||||
def get_queryset(self):
|
||||
keywords = self.q.split()
|
||||
return super().search(keywords)
|
Loading…
Add table
Add a link
Reference in a new issue