示例#1
0
def showUsers():
    if request.method == 'POST':
        return UserHandler().addUser(request.form)
    else:
        if not request.args:
            return UserHandler().getAllUser()
        else:
            return UserHandler().userSearch(request.args)
示例#2
0
文件: api.py 项目: Rahul529/appoint
	def get(self,request,username,requestId):
		try:
			user=UserHandler(username)
			if user.user is not None:
				userRequest = user.getRequests(requestId)
				return HttpResponse(json.dumps({"request":userRequest,"status":1}))
			else:
				return HttpResponse(json.dumps({"message":"please register and use the app"}))
		except:
			return HttpResponse(json.dumps({"message":"Its no good","status":0}))
示例#3
0
文件: api.py 项目: Rahul529/appoint
	def get(self,request,username):
		# try:
		user=UserHandler(username)
		# print user.user
		if user.user is not None:

			requests = user.getRequests()
			return HttpResponse(json.dumps({"status":"1","user_requests":requests}))
		else:
			return HttpResponse(json.dumps({"message":"Its no good"}))
示例#4
0
文件: api.py 项目: Rahul529/appoint
	def get(self,request,username):
		try:

			# print "In user Object"
			user= UserHandler(username)
			if user.user is not None:			 
				# print user.getUser()
				u=user.getUser()
				return HttpResponse(json.dumps({"user":u,"status":"success"}))
			else:
				return HttpResponse(json.dumps({"message":"User does not exist or try correct username","status":"success"}))

		except ObjectDoesNotExist:
			return HttpResponse(json.dumps({"message":"User does not exist or try correct username","status":"success"}))
示例#5
0
def getUserRequested(uid):
    return UserHandler().getResourceRequest(uid)
示例#6
0
def getUserBought(uid):
    return UserHandler().getResourceBought(uid)
示例#7
0
def getUserTransacactions(uid):
    return UserHandler().getUserTransaction(uid)
示例#8
0
def userPay():
    return UserHandler().userPay(request.form)
示例#9
0
def userRequests():
    return UserHandler().createRequest(request.form)
示例#10
0
def getUserCards(uid):
    return UserHandler().getCardbyID(uid)
示例#11
0
def userCards():
    return UserHandler().updateUserCreditCard(request.form)
示例#12
0
def getUser(uid):
    return UserHandler().getUserbyId(uid)