POST /events/:id/discounts/:discount_id/
        Updates a discount; returns the result as a :format:`discount` as the key ``discount``.
182142
def post_event_discount(self, id, discount_id, **data):
        
        
        return self.post("/events/{0}/discounts/{0}/".format(id,discount_id), data=data)
429136
def add_or_update(uid, post_data):
        '''
        
        '''
        cur_rec = MPost.get_by_uid(uid)
        if cur_rec:
            MPost.update(uid, post_data)
        else:
            MPost.create_post(uid, post_data)
203121
def update(self, typ, id, **kwargs):
        
        return self._load(self._request(typ, id=id, method='PUT', data=kwargs))
696801
def update_reimburse(self, card_id, encrypt_code, reimburse_status):
        
        return self._post(
            'reimburse/updateinvoicestatus',
            data={
                'card_id': card_id,
                'encrypt_code': encrypt_code,
                'reimburse_status': reimburse_status,
            },
        )
256799
def post_event(self, id, **data):
        
        
        return self.post("/events/{0}/".format(id), data=data)
572520
def update(value, options = {})
      raise Diplomat::IdParameterRequired unless value['ID'] || value[:ID]

      custom_params = use_cas(@options)
      @raw = send_put_request(@conn, ['/v1/acl/update'], options, value, custom_params)
      parse_body
    end
71994
def update_rating(self, postid):
        '''
        
        '''
        post_data = self.get_post_data()
        rating = float(post_data['rating'])
        postinfo = MPost.get_by_uid(postid)
        if postinfo and self.userinfo:
            MRating.update(postinfo.uid, self.userinfo.uid, rating=rating)
            self.update_post(postid)
        else:
            return False
647589
def post_event_public_discounts(self, id, **data):
        
        
        return self.post("/events/{0}/public_discounts/".format(id), data=data)
498015
def post_venue(self, id, **data):
        
        
        return self.post("/venues/{0}/".format(id), data=data)
981335
def post_event_public_discount(self, id, discount_id, **data):
        
        
        return self.post("/events/{0}/public_discounts/{0}/".format(id,discount_id), data=data)
253794
def update(key, definition, options = {})
      custom_params = options[:dc] ? use_named_parameter('dc', options[:dc]) : nil
      ret = send_put_request(@conn, ["/v1/query/#{key}"], options, definition, custom_params)
      ret.status == 200
    end
619770
def update(self, session, **kwargs):
        ''''''
        request = TOPRequest('taobao.fenxiao.discount.update')
        for k, v in kwargs.iteritems():
            if k not in ('discount_id', 'discount_name', 'discount_status', 'detail_ids', 'target_types', 'target_ids', 'discount_types', 'discount_values', 'detail_statuss') and v==None: continue
            request[k] = v
        self.create(self.execute(request, session), fields=['is_success',])
        return self.is_success
628560
def query_coupon(self, coupon_id, user_id,
                     op_user_id=None, device_info=None):
        
        data = {
            'coupon_id': coupon_id,
            'openid': user_id,
            'appid': self.appid,
            'op_user_id': op_user_id,
            'device_info': device_info,
            'version': '1.0',
            'type': 'XML',
        }
        return self._post('promotion/query_coupon', data=data)
1205780
def update_express(self, template_id, delivery_template):
        
        delivery_template['template_id'] = template_id
        return self._post(
            'merchant/express/update',
            data=delivery_template
        )
366380
def update_shelf(self, shelf_id, shelf_data):
        
        shelf_data['shelf_id'] = shelf_id
        return self._post(
            'merchant/shelf/mod',
            data=shelf_data
        )
433591
def post_event_ticket_class(self, id, ticket_class_id, **data):
        
        
        return self.post("/events/{0}/ticket_classes/{0}/".format(id,ticket_class_id), data=data)
1140295
def get_and_update(cls, id, **kwargs):
        
        model = cls.get(id)
        for k, v in cls._preprocess_params(kwargs).items():
            setattr(model, k, v)
        cls.session.commit()
        return model