def index(request):
latest_files = File.objects.order_by("-posted_date")[:10]
latest_updated_families = ProductFamily.objects \
.annotate(last_posted_date=Max('file__posted_date')) \
.order_by('-last_posted_date')[:10]
groups = ProductGroup.objects.order_by("name")
total_count = File.objects.count()
fcu_banner_expiration_date = datetime.date(2017, 11, 10)
show_fcu_banner = datetime.date.today() < fcu_banner_expiration_date
context = {
'show_fcu_banner': show_fcu_banner,
'latest_files': latest_files,
'latest_updated_families': latest_updated_families,
'groups': groups, 'total_count': total_count,
}
return render(request, 'msdn/index.html', context)
评论列表
文章目录