Skip to content
Snippets Groups Projects
Verified Commit 34d600d9 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

See #432: can now build custom radios using tags

parent e21e0e50
No related branches found
No related tags found
No related merge requests found
......@@ -178,9 +178,9 @@ class TagFilter(RadioFilter):
"autocomplete_fields": {
"remoteValues": "results",
"name": "name",
"value": "slug",
"value": "name",
},
"autocomplete_qs": "query={query}",
"autocomplete_qs": "q={query}&ordering=length",
"label": "Tags",
"placeholder": "Select tags",
}
......@@ -189,4 +189,8 @@ class TagFilter(RadioFilter):
label = "Tag"
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)
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment