views.py 文件源码

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

项目:lushi8 作者: ieiayaobb 项目源码 文件源码
def get_index(request):
    # response = requests.get('http://127.0.0.1:8000/api/chairmans/')
    # chairmans = response.json()

    if 'type' in request.GET:
        type = request.GET['type']
        chairmans = Chairman.objects.filter(type=type).order('-num')
    else:
        chairmans = Chairman.objects.all().order('-num')

    # chairmans_set = SortedSet('chairmans_set')
    # chairmans_hash = SortedSet('chairmans_hash')
    # chairmans = map(_convert_chairman, chairmans_set.revmembers)
    # chairmans = map(_convert_chairman, chairmans_hash.members)

    return render_to_response('index.html', locals(),
                              context_instance=RequestContext(request))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号