kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
See #432: can now build custom radios using tags
rodzic
e21e0e50d1
commit
34d600d9df
|
@ -178,9 +178,9 @@ class TagFilter(RadioFilter):
|
||||||
"autocomplete_fields": {
|
"autocomplete_fields": {
|
||||||
"remoteValues": "results",
|
"remoteValues": "results",
|
||||||
"name": "name",
|
"name": "name",
|
||||||
"value": "slug",
|
"value": "name",
|
||||||
},
|
},
|
||||||
"autocomplete_qs": "query={query}",
|
"autocomplete_qs": "q={query}&ordering=length",
|
||||||
"label": "Tags",
|
"label": "Tags",
|
||||||
"placeholder": "Select tags",
|
"placeholder": "Select tags",
|
||||||
}
|
}
|
||||||
|
@ -189,4 +189,8 @@ class TagFilter(RadioFilter):
|
||||||
label = "Tag"
|
label = "Tag"
|
||||||
|
|
||||||
def get_query(self, candidates, names, **kwargs):
|
def get_query(self, candidates, names, **kwargs):
|
||||||
return Q(tags__slug__in=names)
|
return (
|
||||||
|
Q(tagged_items__tag__name__in=names)
|
||||||
|
| Q(artist__tagged_items__tag__name__in=names)
|
||||||
|
| Q(album__tagged_items__tag__name__in=names)
|
||||||
|
)
|
||||||
|
|
Ładowanie…
Reference in New Issue