Subversion Repositories SmartDukaan

Rev

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

Rev 16371 Rev 16487
Line 1245... Line 1245...
1245
class DealNotification():
1245
class DealNotification():
1246
    
1246
    
1247
    def on_get(self,req,resp,skuBundleIds):
1247
    def on_get(self,req,resp,skuBundleIds):
1248
        result = Mongo.getDealsForNotification(skuBundleIds)
1248
        result = Mongo.getDealsForNotification(skuBundleIds)
1249
        resp.body = dumps(result)
1249
        resp.body = dumps(result)
1250
        
-
 
1251
 
1250
 
-
 
1251
class DealPoints():
-
 
1252
    
-
 
1253
    def on_get(self, req, resp):
-
 
1254
        
-
 
1255
        offset = req.get_param_as_int("offset")
-
 
1256
        limit = req.get_param_as_int("limit")
-
 
1257
        
-
 
1258
        result = Mongo.getAllBundlesWithDealPoints(offset, limit)
-
 
1259
        resp.body = dumps(result)
1252
 
1260
 
-
 
1261
    
-
 
1262
    def on_post(self, req, resp):
-
 
1263
        
-
 
1264
        
-
 
1265
        try:
-
 
1266
            result_json = json.loads(req.stream.read(), encoding='utf-8')
-
 
1267
        except ValueError:
-
 
1268
            raise falcon.HTTPError(falcon.HTTP_400,
-
 
1269
                'Malformed JSON',
-
 
1270
                'Could not decode the request body. The '
-
 
1271
                'JSON was incorrect.')
-
 
1272
            
-
 
1273
        result = Mongo.addDealPoints(result_json)
-
 
1274
        resp.body = json.dumps(result, encoding='utf-8')
1253
 
1275
 
1254
def main():
1276
def main():
1255
    #tagActivatedReatilers()
1277
    #tagActivatedReatilers()
1256
    a = RetailerDetail()
1278
    a = RetailerDetail()
1257
    retailer = a.getNotActiveRetailer()
1279
    retailer = a.getNotActiveRetailer()