Example #1
0
 def __lt__(self, other):
     return title_sort_key(self.name) == title_sort_key(other.name)
Example #2
0
def index(request):
    return render(request, 'tvshows/index.html', {'shows': sorted(Show.objects.all(), key=lambda x: title_sort_key(x.name))})
Example #3
0
File: views.py Project: jradd/CMi
def index(request):
    shows = sorted(Show.objects.all(), key=lambda x: title_sort_key(x.name))
    shows = [ListItem('/tvshows/%s' % show.pk, show.name, show.unwatched_episodes().count()) for show in shows if show.unwatched_episodes()]
    rows = chunks(shows, 2)
    return render(request, 'list.html', {'title': 'TV Shows', 'rows': rows})
Example #4
0
 def __lt__(self, other):
     return title_sort_key(self.name) == title_sort_key(other.name)
Example #5
0
def index(request):
    return render(request, 'tvshows/index.html', {
        'shows':
        sorted(Show.objects.all(), key=lambda x: title_sort_key(x.name))
    })