1 # -*- encoding: utf-8 -*-
3 __author__= "Łukasz Rekucki"
4 __date__ = "$2009-09-25 15:49:50$"
5 __doc__ = "Module documentation."
7 from piston.handler import BaseHandler, AnonymousBaseHandler
9 from explorer.models import PullRequest
11 class PullRequestListHandler(BaseHandler):
12 allowed_methods = ('GET',)
14 def read(self, request):
15 if request.user.has_perm('explorer.book.can_share'):
16 return PullRequest.objects.all()
18 return PullRequest.objects.filter(commiter=request.user)
21 class PullRequestHandler(BaseHandler):
22 allowed_methods = ('GET',)
24 def read(self, request, prq_id):
25 return PullRequest.objects.get(id=prq_id)