Subversion Repositories SmartDukaan

Rev

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

Rev 10924 Rev 11015
Line 8... Line 8...
8
    to_t_source_item_pricing, to_t_product_notification_request, \
8
    to_t_source_item_pricing, to_t_product_notification_request, \
9
    to_t_banner, to_t_banner_map, to_t_product_notification_request_count, \
9
    to_t_banner, to_t_banner_map, to_t_product_notification_request_count, \
10
    to_t_voucher_item_mapping, to_t_insurer, to_t_Amazonlisted, to_t_ebay_item, \
10
    to_t_voucher_item_mapping, to_t_insurer, to_t_Amazonlisted, to_t_ebay_item, \
11
    to_t_uri_mapping, to_t_banner_list, to_t_campaign,to_t_snapdeal_item, \
11
    to_t_uri_mapping, to_t_banner_list, to_t_campaign,to_t_snapdeal_item, \
12
    to_t_snapdeal_item_details, to_t_product_feed_submit, to_t_marketplace_items, to_t_marketplace_itemprice,\
12
    to_t_snapdeal_item_details, to_t_product_feed_submit, to_t_marketplace_items, to_t_marketplace_itemprice,\
13
    to_t_marketplacepercentage, to_t_flipkart_item, to_t_flipkart_item_details
13
    to_t_marketplacepercentage, to_t_flipkart_item, to_t_flipkart_item_details, \
14
    
14
    to_t_market_place_history
15
from shop2020.model.v1.catalog.impl.DataAcessors import add_item, retire_item, \
15
from shop2020.model.v1.catalog.impl.DataAcessors import add_item, retire_item, \
16
    change_item_status, get_item, get_all_items, get_all_items_by_status, \
16
    change_item_status, get_item, get_all_items, get_all_items_by_status, \
17
    update_item, start_item_on, close_session, retire_item_on, \
17
    update_item, start_item_on, close_session, retire_item_on, \
18
    get_items_by_catalog_id, get_best_deals, get_best_deals_catalog_ids, \
18
    get_items_by_catalog_id, get_best_deals, get_best_deals_catalog_ids, \
19
    get_best_deals_count, get_best_sellers, get_latest_arrivals, \
19
    get_best_deals_count, get_best_sellers, get_latest_arrivals, \
Line 58... Line 58...
58
    delete_product_feed_submit, get_all_product_feed_submit, get_snapdeal_item_detail,\
58
    delete_product_feed_submit, get_all_product_feed_submit, get_snapdeal_item_detail,\
59
    get_marketplace_details_for_item, update_marketplace_attributes_for_item,\
59
    get_marketplace_details_for_item, update_marketplace_attributes_for_item,\
60
    get_costing_for_marketplace, get_all_marketplace_items_for_priceupdate, update_marketplace_priceupdate_status, \
60
    get_costing_for_marketplace, get_all_marketplace_items_for_priceupdate, update_marketplace_priceupdate_status, \
61
    update_item_hold_inventory, update_nlc_at_marketplaces, get_all_flipkart_items, get_flipkart_item, \
61
    update_item_hold_inventory, update_nlc_at_marketplaces, get_all_flipkart_items, get_flipkart_item, \
62
    add_or_update_flipkart_item, get_flipkart_item_detail, get_flipkart_items, search_flipkart_items, \
62
    add_or_update_flipkart_item, get_flipkart_item_detail, get_flipkart_items, search_flipkart_items, \
63
    get_count_for_flipkart_items, get_flipkart_search_result_count, get_all_fk_items, get_flipkart_item_by_sku_at_flipkart, \
63
    get_count_for_flipkart_items, get_flipkart_search_result_count, get_all_fk_items, get_flipkart_item_by_sku_at_flipkart,\
-
 
64
    get_marketplace_history, get_all_fbb_listed_items, get_count_for_marketplaceHistory, get_marketplace_history_by_date,\
64
    get_all_fbb_listed_items, get_all_fbb_pricing_items
65
    get_all_fbb_pricing_items
65
    
66
    
66
from shop2020.thriftpy.model.v1.catalog.ttypes import status
67
from shop2020.thriftpy.model.v1.catalog.ttypes import status
67
from shop2020.utils.Utils import log_entry, to_py_date
68
from shop2020.utils.Utils import log_entry, to_py_date
68
import datetime
69
import datetime
69
 
70
 
Line 1483... Line 1484...
1483
            return [to_t_flipkart_item_details(item,None) for item in get_all_fk_items()]
1484
            return [to_t_flipkart_item_details(item,None) for item in get_all_fk_items()]
1484
        finally:
1485
        finally:
1485
            close_session()
1486
            close_session()
1486
    
1487
    
1487
    def getFlipkartItemBySkyAtFlipkart(self,sku):
1488
    def getFlipkartItemBySkyAtFlipkart(self,sku):
1488
        return to_t_flipkart_item(get_flipkart_item_by_sku_at_flipkart(sku))
1489
        return to_t_flipkart_item(get_flipkart_item_by_sku_at_flipkart(sku))    
-
 
1490
    
-
 
1491
    def getMarketplaceHistory(self,source, offset, itemId):
-
 
1492
        try:
-
 
1493
            return [to_t_market_place_history(item) for item in get_marketplace_history(source, offset, itemId)]
-
 
1494
        finally:
-
 
1495
            close_session()    
1489
    
1496
    
1490
    def getAllFbbListedItems(self):
1497
    def getAllFbbListedItems(self):
1491
        try:
1498
        try:
1492
            items = get_all_fbb_listed_items()
1499
            items = get_all_fbb_listed_items()
1493
            ret_items = []
1500
            ret_items = []
Line 1508... Line 1515...
1508
            return ret_items
1515
            return ret_items
1509
        finally:
1516
        finally:
1510
            close_session()
1517
            close_session()
1511
                
1518
                
1512
    
1519
    
-
 
1520
    def getMarketplaceHistoryByDate(self,source,startDate,endDate,offset,limit,itemId):
-
 
1521
        try:
-
 
1522
            return [to_t_market_place_history(item) for item in get_marketplace_history_by_date(source,startDate,endDate,offset,limit,itemId)]
-
 
1523
        finally:
-
 
1524
            close_session()
-
 
1525
    
-
 
1526
    def getCountForMarketplaceHistory(self,source,itemId):
-
 
1527
        try:
-
 
1528
            return get_count_for_marketplaceHistory(source,itemId)
-
 
1529
        finally:
-
 
1530
            close_session()
-
 
1531
        
-
 
1532
    
1513
if __name__ == '__main__':
1533
if __name__ == '__main__':
1514
    items = get_all_alive_items()
1534
    items = get_all_alive_items()
1515
    ret_items = []
1535
    ret_items = []
1516
    for item in items:
1536
    for item in items:
1517
        if item:
1537
        if item:
Line 1526... Line 1546...
1526
        else:
1546
        else:
1527
            return True
1547
            return True
1528
    elif item.status == status.COMING_SOON:
1548
    elif item.status == status.COMING_SOON:
1529
        return True
1549
        return True
1530
    else:
1550
    else:
1531
        return False
-
 
1532
1551
        return False
-
 
1552
 
-
 
1553