コード例 #1
0
 def setUp(self):
     self.genBorrowReq = actUtils.createBorrowRequestAction(
         Tool.objects.get(name="Hoe"),
         profUtils.getProfileFromUsername("TaikhoomAttar"))
     self.genJoinReq = actUtils.createShedRequestAction(
         Shed.objects.get(name="Taikhoom's Shed"),
         profUtils.getProfileFromUsername("TaikhoomAttar"))
コード例 #2
0
ファイル: views.py プロジェクト: roycohen2013/TheSquad
def borrow_tool(request, id):
    if request.user.is_anonymous():
        return HttpResponseRedirect('/accounts/login')
    else:
        borrowerProfile = profileUtil.getProfileFromUser(request.user)
        toolObject = toolUtil.getToolFromID(id)
        ownerProfile = toolObject.owner
        actionObject = actionUtil.createBorrowRequestAction(toolObject, borrowerProfile)
        return HttpResponseRedirect('/tools/' + id + '/request_sent')
コード例 #3
0
ファイル: views.py プロジェクト: roycohen2013/TheSquad
def borrow_tool(request, id):
    if request.user.is_anonymous():
        return HttpResponseRedirect('/accounts/login')
    else:
        borrowerProfile = profileUtil.getProfileFromUser(request.user)
        toolObject = toolUtil.getToolFromID(id)
        ownerProfile = toolObject.owner
        actionObject = actionUtil.createBorrowRequestAction(
            toolObject, borrowerProfile)
        return HttpResponseRedirect('/tools/' + id + '/request_sent')
コード例 #4
0
	def setUp (self):
		self.genBorrowReq = actUtils.createBorrowRequestAction (Tool.objects.get (name = "Hoe"), profUtils.getProfileFromUsername ("TaikhoomAttar"))
		self.genJoinReq = actUtils.createShedRequestAction (Shed.objects.get (name = "Taikhoom's Shed"), profUtils.getProfileFromUsername ("TaikhoomAttar"))