| Line 1... |
Line 1... |
| 1 |
'''
|
1 |
'''
|
| 2 |
Created on 28-Apr-2010
|
2 |
Created on 28-Apr-2010
|
| 3 |
|
3 |
|
| 4 |
@author: ashish
|
4 |
@author: ashish
|
| 5 |
'''
|
5 |
'''
|
| - |
|
6 |
from shop2020.helpers.impl.DataAccessor import close_session
|
| 6 |
from shop2020.model.v1.user.impl import UserDataAccessors, CartDataAccessors
|
7 |
from shop2020.model.v1.user.impl import UserDataAccessors, CartDataAccessors
|
| 7 |
from shop2020.model.v1.user.impl.CartDataAccessors import create_cart, get_cart, \
|
8 |
from shop2020.model.v1.user.impl.CartDataAccessors import create_cart, get_cart, \
|
| 8 |
get_cart_by_id, get_carts_between, add_item_to_cart, add_address_to_cart, \
|
9 |
get_cart_by_id, get_carts_between, add_item_to_cart, add_address_to_cart, \
|
| 9 |
commit_cart, validate_cart, merge_cart, delete_item_from_cart, check_out, \
|
10 |
commit_cart, validate_cart, merge_cart, delete_item_from_cart, check_out, \
|
| 10 |
reset_cart, apply_coupon_to_cart, remove_coupon, get_carts_with_coupon_count, \
|
11 |
reset_cart, apply_coupon_to_cart, remove_coupon, get_carts_with_coupon_count, \
|
| 11 |
delete_discounts_from_cart, save_discounts, show_cod_option, insure_item, \
|
12 |
delete_discounts_from_cart, save_discounts, show_cod_option, insure_item, \
|
| 12 |
cancel_insurance, store_insurance_specific_details, is_insurance_detail_present, \
|
13 |
cancel_insurance, store_insurance_specific_details, is_insurance_detail_present, \
|
| 13 |
add_store_to_cart, get_products_added_to_cart, validate_cart_plus
|
14 |
add_store_to_cart, get_products_added_to_cart, validate_cart_plus
|
| 14 |
from shop2020.model.v1.user.impl.Converters import to_t_user, to_t_cart, \
|
15 |
from shop2020.model.v1.user.impl.Converters import to_t_user, to_t_cart, \
|
| 15 |
to_t_address, to_t_user_communication, to_t_master_affiliate, to_t_affiliate, \
|
16 |
to_t_address, to_t_user_communication, to_t_master_affiliate, to_t_affiliate, \
|
| 16 |
to_t_tracker, to_t_track_log,to_t_private_deal
|
17 |
to_t_tracker, to_t_track_log, to_t_private_deal
|
| 17 |
from shop2020.model.v1.user.impl.Dataservice import UserWidgetItem
|
18 |
from shop2020.model.v1.user.impl.Dataservice import UserWidgetItem
|
| 18 |
from shop2020.model.v1.user.impl.UserDataAccessors import create_user, \
|
19 |
from shop2020.model.v1.user.impl.UserDataAccessors import create_user, \
|
| 19 |
update_user, get_user_by_id, get_user_by_email, update_password, \
|
20 |
update_user, get_user_by_id, get_user_by_email, update_password, \
|
| 20 |
set_user_as_logged_out, set_user_as_logged_in, remove_address_for_user, \
|
21 |
set_user_as_logged_out, set_user_as_logged_in, remove_address_for_user, \
|
| 21 |
add_address_for_user, authenticate_user, user_exists, initialize, \
|
22 |
add_address_for_user, authenticate_user, user_exists, initialize, \
|
| Line 29... |
Line 30... |
| 29 |
get_master_affiliate_by_name, get_affiliates_by_master_affiliate, \
|
30 |
get_master_affiliate_by_name, get_affiliates_by_master_affiliate, \
|
| 30 |
get_all_master_affiliates, get_my_research_items, get_browse_history_items, \
|
31 |
get_all_master_affiliates, get_my_research_items, get_browse_history_items, \
|
| 31 |
update_my_research, delete_item_from_my_research, update_browse_history, \
|
32 |
update_my_research, delete_item_from_my_research, update_browse_history, \
|
| 32 |
get_user_by_mobile_number, is_alive, increase_trust_level, get_user_by_cart_id, \
|
33 |
get_user_by_mobile_number, is_alive, increase_trust_level, get_user_by_cart_id, \
|
| 33 |
get_trust_level, remove_user_communication, get_user_emails, \
|
34 |
get_trust_level, remove_user_communication, get_user_emails, \
|
| 34 |
is_private_deal_user,add_private_deal_user,change_private_deal_user_status,get_private_deal_user
|
35 |
is_private_deal_user, add_private_deal_user, change_private_deal_user_status, \
|
| - |
|
36 |
get_private_deal_user, register_counter
|
| 35 |
from shop2020.thriftpy.model.v1.user.ttypes import ShoppingCartException
|
37 |
from shop2020.thriftpy.model.v1.user.ttypes import ShoppingCartException
|
| 36 |
from shop2020.utils.Utils import log_entry, to_py_date
|
38 |
from shop2020.utils.Utils import log_entry, to_py_date
|
| 37 |
|
39 |
|
| 38 |
|
40 |
|
| 39 |
|
41 |
|
| Line 882... |
Line 884... |
| 882 |
def getPrivateDealUser(self,userId):
|
884 |
def getPrivateDealUser(self,userId):
|
| 883 |
try:
|
885 |
try:
|
| 884 |
return to_t_private_deal(get_private_deal_user(userId))
|
886 |
return to_t_private_deal(get_private_deal_user(userId))
|
| 885 |
finally:
|
887 |
finally:
|
| 886 |
self.closeSession()
|
888 |
self.closeSession()
|
| - |
|
889 |
|
| - |
|
890 |
def registerCounter(self, tCounter, userId):
|
| - |
|
891 |
try:
|
| - |
|
892 |
return register_counter(tCounter, userId)
|
| - |
|
893 |
finally:
|
| - |
|
894 |
self.closeSession()
|
| 887 |
|
895 |
|
| 888 |
def isAlive(self, ):
|
896 |
def isAlive(self, ):
|
| 889 |
"""
|
897 |
"""
|
| 890 |
For checking weather service is active alive or not. It also checks connectivity with database
|
898 |
For checking weather service is active alive or not. It also checks connectivity with database
|
| 891 |
"""
|
899 |
"""
|