Subversion Repositories SmartDukaan

Rev

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

Rev 14096 Rev 14352
Line 41... Line 41...
41
                    'Could not decode the request body. The '
41
                    'Could not decode the request body. The '
42
                    'JSON was incorrect.')
42
                    'JSON was incorrect.')
43
        result = Mongo.getMerchantOrdersByUser(int(userId), page, window, searchMap)
43
        result = Mongo.getMerchantOrdersByUser(int(userId), page, window, searchMap)
44
        resp.body = json.dumps(result, encoding='utf-8')
44
        resp.body = json.dumps(result, encoding='utf-8')
45
        
45
        
-
 
46
class Orders():
-
 
47
    def on_get(self, req, resp):
-
 
48
        page = req.get_param_as_int("page")
-
 
49
        window = req.get_param_as_int("window")
-
 
50
        string1 = req.get_param("searchMap")
-
 
51
        searchMap={}
-
 
52
        if string1 is None or string1 == "":
-
 
53
            pass
-
 
54
        else:
-
 
55
            try:
-
 
56
                searchMap = json.loads(string1, encoding='utf-8')
-
 
57
            except:
-
 
58
                raise falcon.HTTPError(falcon.HTTP_400,
-
 
59
                    'Malformed JSON',
-
 
60
                    'Could not decode the request body. The '
-
 
61
                    'JSON was incorrect.')
-
 
62
        result = Mongo.getMerchantOrdersByUser(None, page, window, searchMap)
-
 
63
        resp.body = json.dumps(result, encoding='utf-8')
-
 
64
        
46
class Track():
65
class Track():
47
    def on_post(self, req, resp, userId):
66
    def on_post(self, req, resp, userId):
48
        try:
67
        try:
49
            string1 = req.stream.read()
68
            string1 = req.stream.read()
50
            req_obj = urlparse.parse_qs(string1)
69
            req_obj = urlparse.parse_qs(string1)