Subversion Repositories SmartDukaan

Rev

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

Rev 17569 Rev 17611
Line 1501... Line 1501...
1501
class DeleteDealObject:
1501
class DeleteDealObject:
1502
    def on_get(self, req, resp, id):
1502
    def on_get(self, req, resp, id):
1503
        result = Mongo.deleteDealObject(int(id))
1503
        result = Mongo.deleteDealObject(int(id))
1504
        resp.body = dumps(result)
1504
        resp.body = dumps(result)
1505
 
1505
 
-
 
1506
class FeaturedDealObject:
-
 
1507
    def on_get(self, req, resp):
-
 
1508
        
-
 
1509
        offset = req.get_param_as_int("offset")
-
 
1510
        limit = req.get_param_as_int("limit")
-
 
1511
        
-
 
1512
        result = Mongo.getAllFeaturedDealsForDealObject(offset, limit)
-
 
1513
        resp.body = dumps(result)
-
 
1514
 
-
 
1515
    
-
 
1516
    def on_post(self, req, resp):
-
 
1517
        
-
 
1518
        multi = req.get_param_as_int("multi")
-
 
1519
        
-
 
1520
        try:
-
 
1521
            result_json = json.loads(req.stream.read(), encoding='utf-8')
-
 
1522
        except ValueError:
-
 
1523
            raise falcon.HTTPError(falcon.HTTP_400,
-
 
1524
                'Malformed JSON',
-
 
1525
                'Could not decode the request body. The '
-
 
1526
                'JSON was incorrect.')
-
 
1527
            
-
 
1528
        result = Mongo.addFeaturedDealForDealObject(result_json, multi)
-
 
1529
        resp.body = json.dumps(result, encoding='utf-8')
-
 
1530
 
-
 
1531
 
1506
    
1532
    
1507
    
1533
    
1508
    
1534
    
1509
def main():
1535
def main():
1510
    #tagActivatedReatilers()
1536
    #tagActivatedReatilers()