taobao.item.update.listing 一口价商品上架
        
        单个商品上架 
        输入的num_iid必须属于当前会话用户
331997
def update_listing(self, num_iid, num, session):
        ''''''
        request = TOPRequest('taobao.item.update.listing')
        request['num_iid'] = num_iid
        request['num'] = num
        self.create(self.execute(request, session)['item'])
        return self
1513
def add(self, cid, price, image, name, desc, major, market_time, property_alias, session, **kwargs):
        ''''''
        request = TOPRequest('taobao.product.add')
        request['cid'] = cid
        request['price'] = price
        request['image'] = image
        request['name'] = name
        request['desc'] = desc
        request['major'] = major
        request['market_time'] = market_time
        request['property_alias'] = property_alias
        for k, v in kwargs.iteritems():
            if k not in ('outer_id', 'props', 'binds', 'sale_props', 'customer_props', 'order_by', 'ww_status', 'post_free', 'location_state', 'location_city', 'is_3D', 'start_score', 'end_score', 'start_volume', 'end_volume', 'one_station', 'is_cod', 'is_mall', 'is_prepay', 'genuine_security', 'promoted_service', 'stuff_status', 'start_price', 'end_price', 'page_no', 'page_size', 'auction_flag', 'auto_post', 'has_discount', 'is_xinpin') and v==None: continue
            if k == 'location_state': k = 'location.state'
            if k == 'location_city': k = 'location.city'
            request[k] = v
        self.create(self.execute(request, session)['product'])
        return self
1312039
protected final void listUpdate(List list, int index, Object value) {
        Object converted = value;

        if(list.size() > index) {
            Object o = list.get(index);
            // can only convert types when there is an item in the currently requested place
            if(o != null) {
                Class itemType = o.getClass();
                converted = ParseUtils.convertType(value, itemType);
            }

            list.set(index, value);
        } else {
            // @note: not sure that this is the right thing.  Question is whether or not to insert nulls here to fill list up to "index"
            // @update: List doesn't guarantee that implementations will accept nulls.  So, we can't rely on that as a solution.
            // @update: this is an unfortunate but necessary solution...unless the List has enough elements to 
            // accomodate the new item at a particular index, this must be an error case.  The reasons are this:
            // 1) can't fill the list with nulls, List implementations are allowed to disallow them
            // 2) can't just do an "add" to the list -- in processing [0] and [1] on an empty list, [1] may get processed first. 
            //    this will go into list slot [0].  then, [0] gets processed and simply overwrites the previous because it's 
            //    already in the list
            // 3) can't go to a mixed approach because there's no metadata about what has been done and no time to build
            //    something that is apt to be complicated and exposed to the user
            // so...
            // the ultimate 8.1sp2 functionality is to simply disallow updating a value in a list that doesn't exist.  that 
            // being said, it is still possible to simply add to the list.  if {actionForm.list[42]} inserts into the 42'nd 
            // item, {actionForm.list} will just do an append on POST since there is no index specified.  this fix does 
            // not break backwards compatability because it will work on full lists and is completely broken now on empty 
            // lists, so changing this just gives a better exception message that "ArrayIndexOutOfBounds".  :)
            // 
            // September 2, 2003
            // ekoneil@apache.com
            // 
            String msg = "An error occurred setting a value at index \"" +
                index +
                "\" because the list is " +
                (list != null ? (" of size " + list.size()) : "null") + ".  " +
                "Be sure to allocate enough items in the List to accomodate any updates which may occur against the list.";

            LOGGER.error(msg);
            throw new RuntimeException(msg);
        }
    }
614208
def update(self, buyer_nick, status, session, grade=None, province=None, city=None):
        ''''''
        request = TOPRequest('taobao.crm.memberinfo.update')
        request['buyer_nick'] = buyer_nick
        request['status'] = status
        if grade!=None: request['grade'] = grade
        if province!=None: request['province'] = province
        if city!=None: request['city'] = city
        self.create(self.execute(request, session))
        return self.is_success
1047520
def recommend_delete(self, num_iid, session):
        ''''''
        request = TOPRequest('taobao.item.recommend.delete')
        request['num_iid'] = num_iid
        self.create(self.execute(request, session)['item'])
        return self
1157685
function indexOf(list, item) {
  if (NATIVE_ARRAY_INDEXOF) {
    return NATIVE_ARRAY_INDEXOF.call(list, item);
  }

  for (var i = 0; i < list.length; i++) {
    if (list[i] === item) {
      return i;
    }
  }

  return -1;
}
203962
def items_detail_get(self, num_iids, fields=[], **kwargs):
        ''''''
        request = TOPRequest('taobao.taobaoke.items.detail.get')
        request['num_iids'] = num_iids
        if not fields:
            taobaokeItem = TaobaokeItem()
            fields = taobaokeItem.fields
        request['fields'] = fields
        for k, v in kwargs.iteritems():
            if k not in ('nick', 'outer_code', 'pid') and v==None: continue
            request[k] = v
        self.create(self.execute(request), fields=['taobaoke_item_details', 'total_results'], models={'taobaoke_item_details':TaobaokeItemDetail})
        return self.taobaoke_item_details
1306768
def search(self, current_page, session, **kwargs):
        ''''''
        request = TOPRequest('taobao.crm.members.search')
        request['current_page'] = current_page
        for k, v in kwargs.iteritems():
            if k not in ('buyer_nick', 'grade', 'min_trade_amount', 'max_trade_amount', 'min_trade_count', 'max_trade_count', 'min_last_trade_time', 'max_last_trade_time', 'relation_source', 'min_item_num', 'min_avg_price', 'min_close_trade_num', 'province', 'city', 'group_id', 'page_size', 'order', 'max_avg_price', 'max_item_num', 'max_close_trade_num', 'sort') and v==None: continue
            request[k] = v
        self.create(self.execute(request, session), models={'members':CrmMember})
        return self.members
435263
def update(self, session, title=None, bulletin=None, desc=None):
        ''''''
        request = TOPRequest('taobao.shop.remainshowcase.get')
        if title!=None: request['title'] = title
        if bulletin!=None: request['bulletin'] = bulletin
        if desc!=None: request['desc'] = desc
        self.create(self.execute(request, session)['shop'])
        return self
270560
def get(self, parent_cid=None, cids=[], fields=[]):
        ''''''
        request = TOPRequest('taobao.itemcats.get')
        if not fields:
            itemCat = ItemCat()
            fields = itemCat.fields
        request['fields'] = fields
        if parent_cid!=None:
            request['parent_cid'] = parent_cid
        if cids:
            request['cids'] = ','.join([str(cid) for cid in cids])
        self.create(self.execute(request))
        return self.item_cats
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
857703
function postAddListValue (req, res, next) {
    let key = req.body.key;
    let value = req.body.value;
    let type = req.body.type;
    let connectionId = req.body.connectionId;
    getConnection(req, res, function () {
        addListValue(key, value, type, res, next);
    }, connectionId);
}
263605
def trades_get(self, **kwargs):
        ''''''
        request = TOPRequest('taobao.increment.trades.get')
        for k, v in kwargs.iteritems():
            if k not in ('status', 'nick', 'type', 'start_modified', 'end_modified', 'page_no', 'page_size') and v==None: continue
            request[k] = v
        self.create(self.execute(request), fields=['notify_trades', 'total_results'], models={'notify_trades':NotifyTrade})
        return self.notify_trades
114863
def on_bar(self, event):
        '''
        
        '''
        'while updating the market data'

        print(
            "on_bar account {} ".format(self.account_cookie),
            event.market_data.data
        )
        print(event.send_order)
        try:
            for code in event.market_data.code:

                if self.sell_available.get(code, 0) > 0:
                    print('可以卖出 {}'.format(self._currenttime))
                    event.send_order(
                        account_cookie=self.account_cookie,
                        amount=self.sell_available[code],
                        amount_model=AMOUNT_MODEL.BY_AMOUNT,
                        time=self.current_time,
                        code=code,
                        price=0,
                        order_model=ORDER_MODEL.MARKET,
                        towards=ORDER_DIRECTION.SELL,
                        market_type=self.market_type,
                        frequence=self.frequence,
                        broker_name=self.broker
                    )
                else:
                    print('{} 无仓位, 买入{}'.format(self._currenttime, code))
                    event.send_order(
                        account_cookie=self.account_cookie,
                        amount=100,
                        amount_model=AMOUNT_MODEL.BY_AMOUNT,
                        time=self.current_time,
                        code=code,
                        price=0,
                        order_model=ORDER_MODEL.MARKET,
                        towards=ORDER_DIRECTION.BUY,
                        market_type=self.market_type,
                        frequence=self.frequence,
                        broker_name=self.broker
                    )
        except Exception as e:
            print(e)
1365793
def update_category(uid, post_data):
    '''
    
    '''

    # deprecated
    # catid = kwargs['catid'] if MCategory.get_by_uid(kwargs.get('catid')) else None
    # post_data = self.get_post_data()
    if 'gcat0' in post_data:
        pass
    else:
        return False

    # Used to update MPost2Category, to keep order.
    the_cats_arr = []
    # Used to update post extinfo.
    the_cats_dict = {}

    # for old page. deprecated
    # def_cate_arr.append('def_cat_uid')

    def_cate_arr = ['gcat{0}'.format(x) for x in range(10)]
    for key in def_cate_arr:
        if key not in post_data:
            continue
        if post_data[key] == '' or post_data[key] == '0':
            continue
        # 有可能选重复了。保留前面的
        if post_data[key] in the_cats_arr:
            continue

        the_cats_arr.append(post_data[key] + ' ' * (4 - len(post_data[key])))
        the_cats_dict[key] = post_data[key] + ' ' * (4 - len(post_data[key]))

    # if catid:
    #     def_cat_id = catid
    if the_cats_arr:
        def_cat_id = the_cats_arr[0]
    else:
        def_cat_id = None

    if def_cat_id:
        the_cats_dict['gcat0'] = def_cat_id
        the_cats_dict['def_cat_uid'] = def_cat_id
        the_cats_dict['def_cat_pid'] = MCategory.get_by_uid(def_cat_id).pid

    # Add the category
    logger.info('Update category: {0}'.format(the_cats_arr))
    logger.info('Update category: {0}'.format(the_cats_dict))

    MPost.update_jsonb(uid, the_cats_dict)

    for index, idx_catid in enumerate(the_cats_arr):
        MPost2Catalog.add_record(uid, idx_catid, index)

    # Delete the old category if not in post requests.
    current_infos = MPost2Catalog.query_by_entity_uid(uid, kind='').objects()
    for cur_info in current_infos:
        if cur_info.tag_id not in the_cats_arr:
            MPost2Catalog.remove_relation(uid, cur_info.tag_id)
562592
def items_get(self, session, **kwargs):
        ''''''
        request = TOPRequest('taobao.fenxiao.distributor.items.get')
        for k, v in kwargs.iteritems():
            if k not in ('distributor_id', 'start_modified', 'end_modified', 'page_no', 'page_size', 'product_id') and v==None: continue
            request[k] = v
        self.create(self.execute(request, session), fields=['total_results','records'], models={'records':FenxiaoItemRecord})
        return self.records
200607
function update(itemName, isSnapshot, data) {
		var message, id = getIdFromItemName(itemName);
		message = proto.writeUpdate(id, itemName, isSnapshot, data);
		notify(message);
		return that;
	}