views.py 文件源码

python
阅读 92 收藏 0 点赞 0 评论 0

项目:msdnhash 作者: mauricew 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号