Subversion Repositories SmartDukaan

Rev

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

Rev 14075 Rev 14106
Line 143... Line 143...
143
        categoryId = req.get_param_as_int("categoryId")
143
        categoryId = req.get_param_as_int("categoryId")
144
        offset = req.get_param_as_int("offset")
144
        offset = req.get_param_as_int("offset")
145
        limit = req.get_param_as_int("limit")
145
        limit = req.get_param_as_int("limit")
146
        sort = req.get_param("sort")
146
        sort = req.get_param("sort")
147
        direction = req.get_param_as_int("direction")
147
        direction = req.get_param_as_int("direction")
148
        result = Mongo.getNewDeals(userId, categoryId, offset, limit, sort, direction)
148
        result = Mongo.getNewDeals(int(userId), categoryId, offset, limit, sort, direction)
149
        json_docs = [json.dumps(doc, default=json_util.default) for doc in result]
149
        json_docs = [json.dumps(doc, default=json_util.default) for doc in result]
150
        resp.body = json.dumps(json_docs, encoding='utf-8')
150
        resp.body = json.dumps(json_docs, encoding='utf-8')
151
 
151
 
152
class MasterData():
152
class MasterData():
153
    def on_get(self,req, resp, skuId):
153
    def on_get(self,req, resp, skuId):
Line 263... Line 263...
263
                'Could not decode the request body. The '
263
                'Could not decode the request body. The '
264
                'JSON was incorrect.')
264
                'JSON was incorrect.')
265
            
265
            
266
        result = Mongo.updateCollection(result_json)
266
        result = Mongo.updateCollection(result_json)
267
        resp.body = json.dumps(result, encoding='utf-8')
267
        resp.body = json.dumps(result, encoding='utf-8')
-
 
268
        resp.content_type = "application/json; charset=utf-8"