示例#1
0
文件: views.py 项目: flaxter/CityRank
def datasource_list(request):
	check_session_version(request)
        sources = DataSource.objects.filter(datascheme__type='r', active=True).order_by('id')
	sources_to_aggregate = request.session.get('sources_to_aggregate', DefaultSources)

	for source in sources:
		source.aggregate = source in sources_to_aggregate

	return render_response(request, 'items/ranking_list.html', {'sources': sources, 'ranking_id': request.session.get('ranking_id', 100) + 1})
示例#2
0
文件: views.py 项目: flaxter/CityRank
def index(request):
	check_session_version(request)
	sources_to_aggregate = request.session.get('sources_to_aggregate', DefaultSources)
	source_weights = request.session.get('source_weights', DefaultWeights)

	from django.conf import settings

        weightings = UserRanking.objects.all().order_by('-created')

        latest = weightings[0:15]

	return render_response(request, 'index.html', {'latest': latest })