Subversion Repositories SmartDukaan

Rev

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

Rev 11905 Rev 12133
Line 10... Line 10...
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, \
12
    to_t_snapdeal_item_details, to_t_product_feed_submit, to_t_marketplace_items, \
13
    to_t_marketplace_itemprice, to_t_marketplacepercentage, to_t_flipkart_item, \
13
    to_t_marketplace_itemprice, to_t_marketplacepercentage, to_t_flipkart_item, \
14
    to_t_flipkart_item_details, to_t_market_place_history, to_t_private_deal,to_t_amazonoutofsync, \
14
    to_t_flipkart_item_details, to_t_market_place_history, to_t_private_deal,to_t_amazonoutofsync, \
15
    to_t_private_deals_comparison
15
    to_t_private_deals_comparison, to_t_snapdeal_marketplace_item,to_t_flipkart_marketplace_item
16
from shop2020.model.v1.catalog.impl.DataAcessors import add_item, retire_item, \
16
from shop2020.model.v1.catalog.impl.DataAcessors import add_item, retire_item, \
17
    change_item_status, get_item, get_all_items, get_all_items_by_status, \
17
    change_item_status, get_item, get_all_items, get_all_items_by_status, \
18
    update_item, start_item_on, close_session, retire_item_on, \
18
    update_item, start_item_on, close_session, retire_item_on, \
19
    get_items_by_catalog_id, get_best_deals, get_best_deals_catalog_ids, \
19
    get_items_by_catalog_id, get_best_deals, get_best_deals_catalog_ids, \
20
    get_best_deals_count, get_best_sellers, get_latest_arrivals, \
20
    get_best_deals_count, get_best_sellers, get_latest_arrivals, \
Line 68... Line 68...
68
    get_flipkart_item_by_sku_at_flipkart, get_marketplace_history, \
68
    get_flipkart_item_by_sku_at_flipkart, get_marketplace_history, \
69
    get_all_fbb_listed_items, get_count_for_marketplaceHistory, \
69
    get_all_fbb_listed_items, get_count_for_marketplaceHistory, \
70
    get_marketplace_history_by_date, get_all_fbb_pricing_items, \
70
    get_marketplace_history_by_date, get_all_fbb_pricing_items, \
71
    get_private_deal_details, get_private_deal_items, add_or_update_private_deal, \
71
    get_private_deal_details, get_private_deal_items, add_or_update_private_deal, \
72
    get_all_active_private_deals, get_private_deals_catalog_ids, \
72
    get_all_active_private_deals, get_private_deals_catalog_ids, \
73
    get_private_deals_count,get_amazon_out_of_sync,get_all_private_deals_comparison
73
    get_private_deals_count,get_amazon_out_of_sync,get_all_private_deals_comparison, \
-
 
74
    get_all_snapdeal_marketplaceItem,get_all_flipkart_marketplaceItem 
74
from shop2020.thriftpy.model.v1.catalog.ttypes import status
75
from shop2020.thriftpy.model.v1.catalog.ttypes import status
75
from shop2020.utils.Utils import log_entry, to_py_date
76
from shop2020.utils.Utils import log_entry, to_py_date
76
import datetime
77
import datetime
77
 
78
 
78
class CatalogServiceHandler:
79
class CatalogServiceHandler:
Line 1548... Line 1549...
1548
    
1549
    
1549
    def getCountForMarketplaceHistory(self,source,itemId):
1550
    def getCountForMarketplaceHistory(self,source,itemId):
1550
        try:
1551
        try:
1551
            return get_count_for_marketplaceHistory(source,itemId)
1552
            return get_count_for_marketplaceHistory(source,itemId)
1552
        finally:
1553
        finally:
1553
            close_session()
1554
            close_session()         
1554
        
-
 
1555
           
-
 
1556
            
1555
            
1557
    def getPrivateDealItems(self,offset,limit):
1556
    def getPrivateDealItems(self,offset,limit):
1558
        try:
1557
        try:
1559
            items = []
1558
            items = []
1560
            for item in get_private_deal_items(offset,limit):
1559
            for item in get_private_deal_items(offset,limit):
Line 1595... Line 1594...
1595
    def getAllPrivateDealsComparison(self):
1594
    def getAllPrivateDealsComparison(self):
1596
        try:
1595
        try:
1597
            return [to_t_private_deals_comparison(item) for item in get_all_private_deals_comparison()]
1596
            return [to_t_private_deals_comparison(item) for item in get_all_private_deals_comparison()]
1598
        finally:
1597
        finally:
1599
            close_session()
1598
            close_session()
-
 
1599
    
-
 
1600
    def getAllSnapdealMarketplaceItem(self):
-
 
1601
        try:
-
 
1602
            return [to_t_snapdeal_marketplace_item(item) for item in get_all_snapdeal_marketplaceItem()]
-
 
1603
        finally:
-
 
1604
            close_session()
-
 
1605
    
-
 
1606
    def getAllFlipkartMarketplaceItem(self):
-
 
1607
        try:
-
 
1608
            return [to_t_flipkart_marketplace_item(item) for item in get_all_flipkart_marketplaceItem()]
-
 
1609
        finally:
-
 
1610
            close_session()
-
 
1611
        
1600
                
1612
                
1601
    
1613
    
1602
if __name__ == '__main__':
1614
if __name__ == '__main__':
1603
    items = get_all_alive_items()
1615
    items = get_all_alive_items()
1604
    ret_items = []
1616
    ret_items = []