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))
评论列表
文章目录