Subversion Repositories SmartDukaan

Rev

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

Rev 17653 Rev 17726
Line 1536... Line 1536...
1536
    def on_get(self, req, resp):
1536
    def on_get(self, req, resp):
1537
        category_id = req.get_param_as_int("category_id")
1537
        category_id = req.get_param_as_int("category_id")
1538
        result = Mongo.getSubCategoryForFilter(category_id)
1538
        result = Mongo.getSubCategoryForFilter(category_id)
1539
        resp.body = dumps(result)
1539
        resp.body = dumps(result)
1540
 
1540
 
-
 
1541
class DummyLogin:
-
 
1542
    def on_post(self,req,resp):
-
 
1543
        try:
-
 
1544
            result_json = json.loads(req.stream.read(), encoding='utf-8')
-
 
1545
        except ValueError:
-
 
1546
            raise falcon.HTTPError(falcon.HTTP_400,
-
 
1547
                'Malformed JSON',
-
 
1548
                'Could not decode the request body. The '
-
 
1549
                'JSON was incorrect.')
-
 
1550
            
-
 
1551
        result = Mongo.dummyLogin(result_json)
-
 
1552
        resp.body = json.dumps(result, encoding='utf-8')
-
 
1553
 
-
 
1554
class DummyRegister:
-
 
1555
    def on_post(self,req,resp):
-
 
1556
        try:
-
 
1557
            result_json = json.loads(req.stream.read(), encoding='utf-8')
-
 
1558
        except ValueError:
-
 
1559
            raise falcon.HTTPError(falcon.HTTP_400,
-
 
1560
                'Malformed JSON',
-
 
1561
                'Could not decode the request body. The '
-
 
1562
                'JSON was incorrect.')
-
 
1563
            
-
 
1564
        result = Mongo.dummyRegister(result_json)
-
 
1565
        resp.body = json.dumps(result, encoding='utf-8')
1541
 
1566
 
1542
    
1567
    
1543
    
1568
    
1544
    
1569
    
1545
def main():
1570
def main():