| Line 14... |
Line 14... |
| 14 |
from shop2020.model.v1.catalog.impl.Convertors import to_t_item, to_t_source
|
14 |
from shop2020.model.v1.catalog.impl.Convertors import to_t_item, to_t_source
|
| 15 |
from shop2020.model.v1.catalog.impl.DataService import Item, ItemChangeLog, \
|
15 |
from shop2020.model.v1.catalog.impl.DataService import Item, ItemChangeLog, \
|
| 16 |
Category, EntityIDGenerator, SimilarItems, ProductNotification, Source, \
|
16 |
Category, EntityIDGenerator, SimilarItems, ProductNotification, Source, \
|
| 17 |
SourceItemPricing, AuthorizationLog, VoucherItemMapping, CategoryVatMaster, \
|
17 |
SourceItemPricing, AuthorizationLog, VoucherItemMapping, CategoryVatMaster, \
|
| 18 |
OOSTracker, EntityTag, ItemInsurerMapping, Insurer, Banner, BannerMap, \
|
18 |
OOSTracker, EntityTag, ItemInsurerMapping, Insurer, Banner, BannerMap, \
|
| 19 |
FreebieItem, BrandInfo, Amazonlisted, StorePricing, ItemVatMaster
|
19 |
FreebieItem, BrandInfo, Amazonlisted, StorePricing, ItemVatMaster, \
|
| - |
|
20 |
PageViewEvents, CartEvents
|
| 20 |
from shop2020.thriftpy.model.v1.catalog.ttypes import status, ItemShippingInfo, \
|
21 |
from shop2020.thriftpy.model.v1.catalog.ttypes import status, ItemShippingInfo, \
|
| 21 |
ItemType, PremiumType, FreebieItem as t_FreebieItem, \
|
22 |
ItemType, PremiumType, FreebieItem as t_FreebieItem, \
|
| 22 |
StorePricing as tStorePricing, CatalogServiceException
|
23 |
StorePricing as tStorePricing, CatalogServiceException
|
| 23 |
from shop2020.thriftpy.model.v1.inventory.ttypes import \
|
24 |
from shop2020.thriftpy.model.v1.inventory.ttypes import \
|
| 24 |
InventoryServiceException, IgnoredInventoryUpdateItems
|
25 |
InventoryServiceException, IgnoredInventoryUpdateItems
|
| Line 1806... |
Line 1807... |
| 1806 |
else:
|
1807 |
else:
|
| 1807 |
return False
|
1808 |
return False
|
| 1808 |
|
1809 |
|
| 1809 |
def get_all_parent_categories():
|
1810 |
def get_all_parent_categories():
|
| 1810 |
return Category.query.filter_by(parent_category_id=10000).all()
|
1811 |
return Category.query.filter_by(parent_category_id=10000).all()
|
| 1811 |
|
- |
|
| 1812 |
|
1812 |
|
| - |
|
1813 |
def add_page_view_event(pageEvent):
|
| - |
|
1814 |
page_view_event = PageViewEvents()
|
| - |
|
1815 |
page_view_event.catalogId = pageEvent.catalogId
|
| - |
|
1816 |
page_view_event.url = pageEvent.url
|
| - |
|
1817 |
page_view_event.sellingPrice = pageEvent.sellingPrice
|
| - |
|
1818 |
page_view_event.ip = pageEvent.ip
|
| - |
|
1819 |
page_view_event.sessionId = pageEvent.sessionId
|
| - |
|
1820 |
page_view_event.comingSoon = pageEvent.comingSoon
|
| - |
|
1821 |
page_view_event.eventTimestamp = to_py_date(pageEvent.eventDate)
|
| - |
|
1822 |
session.commit()
|
| - |
|
1823 |
|
| - |
|
1824 |
def add_cart_event(cartEvent):
|
| - |
|
1825 |
cart_event = CartEvents()
|
| - |
|
1826 |
cart_event.catalogId = cartEvent.catalogId
|
| - |
|
1827 |
cart_event.itemId = cartEvent.itemId
|
| - |
|
1828 |
cart_event.inStock = cartEvent.inStock
|
| - |
|
1829 |
cart_event.ip = cartEvent.ip
|
| - |
|
1830 |
cart_event.sessionId = cartEvent.sessionId
|
| - |
|
1831 |
cart_event.comingSoon = cartEvent.comingSoon
|
| - |
|
1832 |
cart_event.sellingPrice = cartEvent.sellingPrice
|
| - |
|
1833 |
cart_event.eventTimestamp = to_py_date(cartEvent.eventDate)
|
| - |
|
1834 |
session.commit()
|
| - |
|
1835 |
|
| - |
|
1836 |
|
| - |
|
1837 |
|
| - |
|
1838 |
|
| - |
|
1839 |
|
| - |
|
1840 |
|
| - |
|
1841 |
|
| - |
|
1842 |
|
| - |
|
1843 |
|
| - |
|
1844 |
|
| - |
|
1845 |
|
| - |
|
1846 |
|
| - |
|
1847 |
|
| - |
|
1848 |
|