Added i18n to 'all' amiibo list

This commit is contained in:
Felipe Martín 2015-09-07 21:02:21 +02:00
parent d3c71ba13f
commit 5ff3bce5e2
1 changed files with 3 additions and 1 deletions

View File

@ -3,6 +3,7 @@
# django
from django.shortcuts import render, get_object_or_404
from django.views.generic.base import View
from django.utils.translation import gettext as _
# amiibo
from amiibofindr.apps.amiibo.models import Collection, Amiibo
@ -10,9 +11,10 @@ from amiibofindr.apps.amiibo.models import Collection, Amiibo
class CollectionView(View):
template = 'amiibo/collection.html'
all_word = _('all')
def get(self, request, collection='all'):
if collection != 'all':
if collection != self.all_word:
collection = get_object_or_404(Collection, slug=collection)
amiibo_list = collection.amiibos
else: