Exemplo n.º 1
0
def deleteTag(request):
    #permission check
    #......
    params = dict()
    params["cid"] = 1   #default!!!
    params["tid"] = request.POST["tid"]                            #delete tag id
    return HttpResponse(json.dumps(DAOHelper.deleteTag(params)))
Exemplo n.º 2
0
 def testDeteleTag(self):
     from MemManageHelper import DAOHelper as helper
     param=dict()
     param["cid"]=1
     param["tid"]=26
     
     result=helper.deleteTag(param)
     print result
     self.assertEqual("true",result["success"],"TestTag")
Exemplo n.º 3
0
def inviteUser(request):
    #permission check
    #......
    params = dict()
    params["cid"] = 1   #default!!!
    params["name"] = request.POST["name"]                           #string
    params["idcard"] = request.POST["idcard"]                       #string
    params["phone"] = request.POST["phone"]                         #string
    params["email"] = request.POST["email"]                         #string
    params["verifyMode"] = request.POST["verifyMode"]               # "1": by name; "2": by idcard; "9": by question
                                                                    # "1+2": by name and idcard;  etc.
                                                                    #  "": without verification
    params["verifyQuestion"] = request.POST["verifyQuestion"]       #string
    params["verifyAnswer"] = request.POST["verifyAnswer"]           #string
    
    return HttpResponse(json.dumps(DAOHelper.inviteUser(params)))
Exemplo n.º 4
0
 def tstInviteRole(self):
     from MemManageHelper import DAOHelper as helper
     params=dict()
     params["cid"]=1
     params["name"]="PyUnitTest"
     params["idcard"]="32431432152"
     params["phone"]="123142334"
     params["email"]="saj@sfakl"
     
     params["verifyMode"]="1+2+9"
     params["verifyQuestion"]="Hello"
     params["verifyAnswer"]="World!"
     
     result=helper.inviteUser(params)
     print result
     self.assertEquals("true",result["success"],"TestDone")
Exemplo n.º 5
0
def addTag(request):
    #add new tag
    return HttpResponse(json.dumps(DAOHelper.addTag(request)))
Exemplo n.º 6
0
def member(request):
    #member ops including visiting
    return render_to_response('members.html',Context(DAOHelper.member(request)))
Exemplo n.º 7
0
def addGroup(request):
    #add new group    
    return HttpResponse(json.dumps(DAOHelper.addGroup(request)))
Exemplo n.º 8
0
def editRoleInfo(request):
    #save specified role info
    return HttpResponse(json.dumps(DAOHelper.editRoleInfo(request)))