Commit a5f514f8 authored by fred's avatar fred

search: add artist next to track result

parent d366e423
......@@ -22,7 +22,7 @@
<h3>{% trans "Tracks" %}</h3>
<ul>
{% for track in tracks %}
<li><a href="{% url 'track-view' pk=track.id %}">{{track.title}}</a></li>
<li><a href="{% url 'track-view' pk=track.id %}">{{track.title}}</a> — {{track.artist.name}}</li>
{% endfor %}
</ul>
......
......@@ -248,5 +248,5 @@ class SearchView(TemplateView):
q = self.request.GET.get('q')
if q:
ctx['artists'] = Artist.objects.filter(name__icontains=q.lower())
ctx['tracks'] = Track.objects.filter(title__icontains=q.lower())
ctx['tracks'] = Track.objects.filter(title__icontains=q.lower()).select_related()
return ctx
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment