Subversion Repositories SmartDukaan

Rev

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

Rev 13865 Rev 13867
Line 118... Line 118...
118
        if req.get_param_as_int("id") is not None:
118
        if req.get_param_as_int("id") is not None:
119
            print "****getting only for id"
119
            print "****getting only for id"
120
            id = req.get_param_as_int("id")
120
            id = req.get_param_as_int("id")
121
            try:
121
            try:
122
                result = FetchLivePrices.getLatestPriceById(id)
122
                result = FetchLivePrices.getLatestPriceById(id)
123
                json_docs = [json.dumps(doc, default=json_util.default) for doc in result]
123
                json_docs = json.dumps(result, default=json_util.default)
124
                resp.body = json.dumps(json_docs, encoding='utf-8')
124
                resp.body = json.dumps(json_docs, encoding='utf-8')
125
            except:
125
            except:
126
                json_docs = json.dumps({}, default=json_util.default)
126
                json_docs = json.dumps({}, default=json_util.default)
127
                resp.body = json.dumps(json_docs, encoding='utf-8')
127
                resp.body = json.dumps(json_docs, encoding='utf-8')
128
            
128