1
0
Fork 0

Use "lower" template filter instead of duplicate values

This commit is contained in:
Shgck 2015-05-02 14:43:10 +02:00
parent 3669857f3d
commit dd6e418814
3 changed files with 4 additions and 3 deletions

View file

@ -72,7 +72,7 @@
{{ release.year }} {{ release.year }}
</td> </td>
<td> <td>
<a href="{% url 'release' release.id %}">{{ release.title }}</a> <a href="{% url 'release' release.tag|lower %}">{{ release.title }}</a>
{% if release.release_type == 1 %}(EP){% endif %} {% if release.release_type == 1 %}(EP){% endif %}
{% if release.release_type == 2 %}(Split){% endif %} {% if release.release_type == 2 %}(Split){% endif %}
{% if release.release_type == 3 %}(Demo){% endif %} {% if release.release_type == 3 %}(Demo){% endif %}

View file

@ -24,7 +24,7 @@
</td> </td>
<td> <td>
<a href="{% url 'release' release.tag_lower %}">{{ release.title }}</a> <a href="{% url 'release' release.tag|lower %}">{{ release.title }}</a>
{% if release.release_type == 1 %}(EP){% endif %} {% if release.release_type == 1 %}(EP){% endif %}
{% if release.release_type == 2 %}(Split){% endif %} {% if release.release_type == 2 %}(Split){% endif %}
{% if release.release_type == 3 %}(Demo){% endif %} {% if release.release_type == 3 %}(Demo){% endif %}

View file

@ -17,6 +17,8 @@ def artists(request):
def artist(request, slug): def artist(request, slug):
artist = get_object_or_404(Artist, slug = slug) artist = get_object_or_404(Artist, slug = slug)
releases = artist.release_set.all() releases = artist.release_set.all()
for release in releases:
release.tag = tools.get_catalog_tag_from_id(release.ident)
context = { "artist": artist, "releases": releases } context = { "artist": artist, "releases": releases }
return render(request, "label/artist.html", context) return render(request, "label/artist.html", context)
@ -32,7 +34,6 @@ def releases(request):
"id": release.id, "id": release.id,
"release_type": release.release_type, "release_type": release.release_type,
"tag": release_tag, "tag": release_tag,
"tag_lower": release_tag.lower(),
"title": release.title, "title": release.title,
"contribs": tools.get_contribs(release.contributors.all()), "contribs": tools.get_contribs(release.contributors.all()),
"year": release.year "year": release.year