Subversion Repositories SmartDukaan

Rev

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

Rev 17726 Rev 17730
Line 1562... Line 1562...
1562
                'JSON was incorrect.')
1562
                'JSON was incorrect.')
1563
            
1563
            
1564
        result = Mongo.dummyRegister(result_json)
1564
        result = Mongo.dummyRegister(result_json)
1565
        resp.body = json.dumps(result, encoding='utf-8')
1565
        resp.body = json.dumps(result, encoding='utf-8')
1566
 
1566
 
-
 
1567
class UpdateUser:
-
 
1568
    def on_post(self,req,resp):
-
 
1569
        try:
-
 
1570
            result_json = json.loads(req.stream.read(), encoding='utf-8')
-
 
1571
        except ValueError:
-
 
1572
            raise falcon.HTTPError(falcon.HTTP_400,
-
 
1573
                'Malformed JSON',
-
 
1574
                'Could not decode the request body. The '
-
 
1575
                'JSON was incorrect.')
-
 
1576
            
-
 
1577
        result = Mongo.updateDummyUser(result_json)
-
 
1578
        resp.body = json.dumps(result, encoding='utf-8')
-
 
1579
 
-
 
1580
class FetchUser:
-
 
1581
    def on_get(self,req,resp):
-
 
1582
        user_id = req.get_param_as_int("user_id")
-
 
1583
        result = Mongo.getDummyUser(user_id)
-
 
1584
        resp.body = json.dumps(result, encoding='utf-8')
-
 
1585
        
-
 
1586
    
-
 
1587
 
1567
    
1588
    
1568
    
1589
    
1569
    
1590
    
1570
def main():
1591
def main():
1571
    #tagActivatedReatilers()
1592
    #tagActivatedReatilers()