Subversion Repositories SmartDukaan

Rev

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

Rev 14552 Rev 14575
Line 272... Line 272...
272
        resp.body = json.dumps(json_docs, encoding='utf-8')
272
        resp.body = json.dumps(json_docs, encoding='utf-8')
273
 
273
 
274
class CommonUpdate():
274
class CommonUpdate():
275
    
275
    
276
    def on_post(self,req,resp):
276
    def on_post(self,req,resp):
-
 
277
        
-
 
278
        multi = req.get_param_as_int("multi")
-
 
279
        
277
        try:
280
        try:
278
            result_json = json.loads(req.stream.read(), encoding='utf-8')
281
            result_json = json.loads(req.stream.read(), encoding='utf-8')
279
        except ValueError:
282
        except ValueError:
280
            raise falcon.HTTPError(falcon.HTTP_400,
283
            raise falcon.HTTPError(falcon.HTTP_400,
281
                'Malformed JSON',
284
                'Malformed JSON',
282
                'Could not decode the request body. The '
285
                'Could not decode the request body. The '
283
                'JSON was incorrect.')
286
                'JSON was incorrect.')
284
            
287
            
285
        result = Mongo.updateCollection(result_json)
288
        result = Mongo.updateCollection(result_json, multi)
286
        resp.body = json.dumps(result, encoding='utf-8')
289
        resp.body = json.dumps(result, encoding='utf-8')
287
        resp.content_type = "application/json; charset=utf-8"
290
        resp.content_type = "application/json; charset=utf-8"
288
 
291
 
289
class NegativeDeals():
292
class NegativeDeals():
290
    
293