Subversion Repositories SmartDukaan

Rev

Rev 17455 | Rev 17659 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17455 Rev 17655
Line 47... Line 47...
47
    def on_post(self, req, resp):
47
    def on_post(self, req, resp):
48
        
48
        
49
        try:
49
        try:
50
            string1 = req.stream.read()
50
            string1 = req.stream.read()
51
            req_json = json.loads(string1, encoding='utf-8')
51
            req_json = json.loads(string1, encoding='utf-8')
-
 
52
            print "req_json",req_json
52
        except ValueError:
53
        except ValueError:
53
            raise falcon.HTTPError(falcon.HTTP_400,
54
            raise falcon.HTTPError(falcon.HTTP_400,
54
                'Malformed JSON',
55
                'Malformed JSON',
55
                'Could not decode the request body. The '
56
                'Could not decode the request body. The '
56
                'JSON was incorrect.')
57
                'JSON was incorrect.')
Line 121... Line 122...
121
                'Malformed JSON',
122
                'Malformed JSON',
122
                'Could not decode the request body. The '
123
                'Could not decode the request body. The '
123
                'JSON was incorrect.')
124
                'JSON was incorrect.')
124
        try:
125
        try:
125
            store = main.getStore(req.get_param_as_int("storeId"))
126
            store = main.getStore(req.get_param_as_int("storeId"))
126
            #print "req_obj",req_obj
127
            print "req_obj",req_obj
127
            result = store.trackOrdersForUser(int(userId),req_obj['url'][0],req_obj['html'][0])
128
            result = store.trackOrdersForUser(int(userId),req_obj['url'][0],req_obj['html'][0])
128
            resp.body = json.dumps({'result':result}, encoding='utf-8')
129
            resp.body = json.dumps({'result':result}, encoding='utf-8')
129
            '''
130
            '''
130
            elif req.get_param_as_int("storeId") == 7:
131
            elif req.get_param_as_int("storeId") == 7:
131
                if 'myprofile' in req_obj['url'][0]:
132
                if 'myprofile' in req_obj['url'][0]: