mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-09 18:12:20 +01:00
Compare commits
1 Commits
marietje-z
...
search
| Author | SHA1 | Date | |
|---|---|---|---|
| b9fa1747c4 |
@ -94,7 +94,10 @@ def songs(request):
|
||||
|
||||
def search_songs():
|
||||
queries = [Q(deleted=False)]
|
||||
queries.extend([Q(Q(artist__icontains=word) | Q(title__icontains=word)) for word in request.POST.get('all', '').split()])
|
||||
|
||||
for word in request.POST.get('all', '').split():
|
||||
regexword = r"".join('[\W]?[' + letter + ']' for letter in word)
|
||||
queries.extend([Q(Q(artist__iregex=regexword) | Q(title__iregex=regexword))])
|
||||
queries.extend([Q(user__name__icontains=word) for word in request.POST.get('uploader', '').split()])
|
||||
|
||||
filter_query = queries.pop()
|
||||
|
||||
Reference in New Issue
Block a user