codereview/dashboard/views.py

18 lines
626 B
Python
Raw Normal View History

2010-11-19 05:12:29 +00:00
from django.shortcuts import render_to_response
2010-12-08 22:01:09 +00:00
from django.template import RequestContext
from django.contrib.auth.decorators import permission_required
2010-11-19 05:12:29 +00:00
from codereview.dashboard.models import Repository
from codereview.review.models import Review
2010-11-19 05:12:29 +00:00
@permission_required('dashboard.browse')
2010-11-19 05:12:29 +00:00
def index(request):
""" List available repositories
"""
repositories = Repository.objects.all()
reviews = Review.objects.all().order_by('-created')
2010-12-08 22:01:09 +00:00
data = RequestContext(request, {
'repositories': repositories,
'reviews': reviews,
2010-12-08 22:01:09 +00:00
})
return render_to_response('dashboard/index.html', data)