Subversion Repositories SmartDukaan

Rev

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

Rev 8362 Rev 8379
Line 41... Line 41...
41
    update_store_pricing, get_amazon_item_details, update_amazon_item_details, \
41
    update_store_pricing, get_amazon_item_details, update_amazon_item_details, \
42
    add_amazon_item, get_asin_items, get_all_fba_listed_items, \
42
    add_amazon_item, get_asin_items, get_all_fba_listed_items, \
43
    get_all_nonfba_listed_items, add_or_update_brand_info, get_brand_info, \
43
    get_all_nonfba_listed_items, add_or_update_brand_info, get_brand_info, \
44
    get_items_status, update_item_inventory, update_timestamp_for_amazon_feeds, \
44
    get_items_status, update_item_inventory, update_timestamp_for_amazon_feeds, \
45
    get_all_parent_categories,add_page_view_event,add_cart_event, \
45
    get_all_parent_categories,add_page_view_event,add_cart_event, \
46
    insert_ebay_item, get_ebay_item, update_ebay_item, update_amazon_attributes_in_bulk
46
    insert_ebay_item, get_ebay_item, update_ebay_item, update_amazon_attributes_in_bulk, \
-
 
47
    get_all_items_to_list_on_fba,get_all_items_to_list_on_nonfba
47
 
48
 
48
from shop2020.thriftpy.model.v1.catalog.ttypes import status
49
from shop2020.thriftpy.model.v1.catalog.ttypes import status
49
from shop2020.utils.Utils import log_entry, to_py_date
50
from shop2020.utils.Utils import log_entry, to_py_date
50
import datetime
51
import datetime
51
 
52
 
Line 1183... Line 1184...
1183
        try:
1184
        try:
1184
            return update_amazon_attributes_in_bulk(amazonlisted)
1185
            return update_amazon_attributes_in_bulk(amazonlisted)
1185
        finally:
1186
        finally:
1186
            close_session()
1187
            close_session()
1187
            
1188
            
-
 
1189
    def getAllItemstoListOnFba(self):
-
 
1190
        try:
-
 
1191
            fba_items = []
-
 
1192
            for item in get_all_items_to_list_on_fba():
-
 
1193
                fba_items.append(to_t_Amazonlisted(item))
-
 
1194
            return fba_items
-
 
1195
        finally:
-
 
1196
            close_session()
-
 
1197
 
-
 
1198
    def getAllItemstoListOnNonFba(self):
-
 
1199
        try:
-
 
1200
            non_fba_items = []
-
 
1201
            for item in get_all_items_to_list_on_nonfba():
-
 
1202
                non_fba_items.append(to_t_Amazonlisted(item))
-
 
1203
            return non_fba_items
-
 
1204
        finally:
-
 
1205
            close_session()
-
 
1206
 
-
 
1207
 
-
 
1208
            
1188
            
1209
            
1189
def is_valid(item):
1210
def is_valid(item):
1190
    if item.status in [status.ACTIVE, status.PAUSED, status.PAUSED_BY_RISK]:
1211
    if item.status in [status.ACTIVE, status.PAUSED, status.PAUSED_BY_RISK]:
1191
        if item.startDate:
1212
        if item.startDate:
1192
            return not(datetime.datetime.now() < item.startDate or item.sellingPrice == 0)
1213
            return not(datetime.datetime.now() < item.startDate or item.sellingPrice == 0)