Subversion Repositories SmartDukaan

Rev

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

Rev 7897 Rev 7977
Line 40... Line 40...
40
    add_or_update_freebie_for_item, get_all_amazon_listed_items, get_store_pricing, \
40
    add_or_update_freebie_for_item, get_all_amazon_listed_items, get_store_pricing, \
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
45
    get_all_parent_categories,add_page_view_event,add_cart_event
46
from shop2020.thriftpy.model.v1.catalog.ttypes import status
46
from shop2020.thriftpy.model.v1.catalog.ttypes import status
47
from shop2020.utils.Utils import log_entry, to_py_date
47
from shop2020.utils.Utils import log_entry, to_py_date
48
import datetime
48
import datetime
49
 
49
 
50
class CatalogServiceHandler:
50
class CatalogServiceHandler:
Line 1154... Line 1154...
1154
            categories = get_all_parent_categories()
1154
            categories = get_all_parent_categories()
1155
            return [to_t_category(category) for category in categories]
1155
            return [to_t_category(category) for category in categories]
1156
        finally:
1156
        finally:
1157
            close_session()
1157
            close_session()
1158
            
1158
            
-
 
1159
    def addPageViewEvent(self,pageEvent):
-
 
1160
        try:
-
 
1161
            print "csh"
-
 
1162
            add_page_view_event(pageEvent)
-
 
1163
        finally:
-
 
1164
            close_session()
-
 
1165
            
-
 
1166
    def addCartEvent(self,cartEvent):
-
 
1167
        try:
-
 
1168
            add_cart_event(cartEvent)
-
 
1169
        finally:
-
 
1170
            close_session()
-
 
1171
            
1159
def is_valid(item):
1172
def is_valid(item):
1160
    if item.status in [status.ACTIVE, status.PAUSED, status.PAUSED_BY_RISK]:
1173
    if item.status in [status.ACTIVE, status.PAUSED, status.PAUSED_BY_RISK]:
1161
        if item.startDate:
1174
        if item.startDate:
1162
            return not(datetime.datetime.now() < item.startDate or item.sellingPrice == 0)
1175
            return not(datetime.datetime.now() < item.startDate or item.sellingPrice == 0)
1163
        else:
1176
        else: