Subversion Repositories SmartDukaan

Rev

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

Rev 10140 Rev 10909
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
from shop2020.model.v1.catalog.impl.DataAcessors import add_item, retire_item, \
14
from shop2020.model.v1.catalog.impl.DataAcessors import add_item, retire_item, \
15
    change_item_status, get_item, get_all_items, get_all_items_by_status, \
15
    change_item_status, get_item, get_all_items, get_all_items_by_status, \
16
    update_item, start_item_on, close_session, retire_item_on, \
16
    update_item, start_item_on, close_session, retire_item_on, \
17
    get_items_by_catalog_id, get_best_deals, get_best_deals_catalog_ids, \
17
    get_items_by_catalog_id, get_best_deals, get_best_deals_catalog_ids, \
18
    get_best_deals_count, get_best_sellers, get_latest_arrivals, \
18
    get_best_deals_count, get_best_sellers, get_latest_arrivals, \
Line 57... Line 57...
57
    delete_product_feed_submit, get_all_product_feed_submit, get_snapdeal_item_detail,\
57
    delete_product_feed_submit, get_all_product_feed_submit, get_snapdeal_item_detail,\
58
    get_marketplace_details_for_item, update_marketplace_attributes_for_item,\
58
    get_marketplace_details_for_item, update_marketplace_attributes_for_item,\
59
    get_costing_for_marketplace, get_all_marketplace_items_for_priceupdate, update_marketplace_priceupdate_status, \
59
    get_costing_for_marketplace, get_all_marketplace_items_for_priceupdate, update_marketplace_priceupdate_status, \
60
    update_item_hold_inventory, update_nlc_at_marketplaces, get_all_flipkart_items, get_flipkart_item, \
60
    update_item_hold_inventory, update_nlc_at_marketplaces, get_all_flipkart_items, get_flipkart_item, \
61
    add_or_update_flipkart_item, get_flipkart_item_detail, get_flipkart_items, search_flipkart_items, \
61
    add_or_update_flipkart_item, get_flipkart_item_detail, get_flipkart_items, search_flipkart_items, \
62
    get_count_for_flipkart_items, get_flipkart_search_result_count, get_all_fk_items, get_flipkart_item_by_sku_at_flipkart
62
    get_count_for_flipkart_items, get_flipkart_search_result_count, get_all_fk_items, get_flipkart_item_by_sku_at_flipkart, \
63
from shop2020.thriftpy.model.v1.catalog.ttypes import status
63
from shop2020.thriftpy.model.v1.catalog.ttypes import status
64
from shop2020.utils.Utils import log_entry, to_py_date
64
from shop2020.utils.Utils import log_entry, to_py_date
65
import datetime
65
import datetime
66
 
66
 
67
class CatalogServiceHandler:
67
class CatalogServiceHandler:
Line 1480... Line 1480...
1480
            return [to_t_flipkart_item_details(item,None) for item in get_all_fk_items()]
1480
            return [to_t_flipkart_item_details(item,None) for item in get_all_fk_items()]
1481
        finally:
1481
        finally:
1482
            close_session()
1482
            close_session()
1483
    
1483
    
1484
    def getFlipkartItemBySkyAtFlipkart(self,sku):
1484
    def getFlipkartItemBySkyAtFlipkart(self,sku):
1485
        return to_t_flipkart_item(get_flipkart_item_by_sku_at_flipkart(sku))        
1485
        return to_t_flipkart_item(get_flipkart_item_by_sku_at_flipkart(sku))
-
 
1486
    
-
 
1487
    def getAllFbbListedItems(self):
-
 
1488
         try:
-
 
1489
            items = get_all_fbb_listed_items()
-
 
1490
            ret_items = []
-
 
1491
            for item in items:
-
 
1492
                if item:
-
 
1493
                    ret_items.append(to_t_Amazonlisted(item))
-
 
1494
            return ret_items
-
 
1495
        finally:
-
 
1496
            close_session()
1486
    
1497
    
1487
if __name__ == '__main__':
1498
if __name__ == '__main__':
1488
    items = get_all_alive_items()
1499
    items = get_all_alive_items()
1489
    ret_items = []
1500
    ret_items = []
1490
    for item in items:
1501
    for item in items:
Line 1500... Line 1511...
1500
        else:
1511
        else:
1501
            return True
1512
            return True
1502
    elif item.status == status.COMING_SOON:
1513
    elif item.status == status.COMING_SOON:
1503
        return True
1514
        return True
1504
    else:
1515
    else:
1505
        return False
1516
        return False
1506
 
-
 
1507
1517