示例#1
0
文件: models.py 项目: loveq369/CMi
 def __lt__(self, other):
     return title_sort_key(self.name) == title_sort_key(other.name)
示例#2
0
文件: views.py 项目: vackraord/CMi
def index(request):
    return render(request, 'tvshows/index.html', {'shows': sorted(Show.objects.all(), key=lambda x: title_sort_key(x.name))})
示例#3
0
文件: views.py 项目: 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})
示例#4
0
文件: models.py 项目: vackraord/CMi
 def __lt__(self, other):
     return title_sort_key(self.name) == title_sort_key(other.name)
示例#5
0
def index(request):
    return render(request, 'tvshows/index.html', {
        'shows':
        sorted(Show.objects.all(), key=lambda x: title_sort_key(x.name))
    })