Subversion Repositories SmartDukaan

Rev

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

Rev 1603 Rev 1845
Line 1... Line 1...
1
from shop2020.thriftpy.model.v1.user.ttypes import Address as TAddress,\
1
from shop2020.thriftpy.model.v1.user.ttypes import Address as TAddress,\
2
    Phone as TPhone, SocialHandles as TSocialHandles, UserCommunication as TUserCommunication,\
2
    Phone as TPhone, SocialHandles as TSocialHandles, UserCommunication as TUserCommunication,\
3
    UserState as TUserState, User as TUser, Cart as TCart, Line as TLine, Sex as TSex
3
    UserState as TUserState, User as TUser, Cart as TCart, Line as TLine, Sex as TSex,\
-
 
4
    Tracker as TTracker, MasterAffiliate as TMasterAffiliate, Affiliate as TAffiliate, TrackLog as TTrackLog
4
from shop2020.utils.Utils import to_java_date
5
from shop2020.utils.Utils import to_java_date
5
 
6
 
6
def to_t_address(address):
7
def to_t_address(address):
7
    t_address = TAddress()
8
    t_address = TAddress()
8
    t_address.id = address.id
9
    t_address.id = address.id
Line 124... Line 125...
124
        t_user_communication.productName = user_communication.product_name
125
        t_user_communication.productName = user_communication.product_name
125
        t_user_communication.subject = user_communication.subject
126
        t_user_communication.subject = user_communication.subject
126
        t_user_communication.message = user_communication.message
127
        t_user_communication.message = user_communication.message
127
        t_user_communication.communication_timestamp = to_java_date(user_communication.communication_timestamp)
128
        t_user_communication.communication_timestamp = to_java_date(user_communication.communication_timestamp)
128
        
129
        
129
    return t_user_communication
-
 
130
130
    return t_user_communication
-
 
131
 
-
 
132
def to_t_master_affiliate(master_affiliate):
-
 
133
    t_master_affiliate = TMasterAffiliate()
-
 
134
    
-
 
135
    if master_affiliate:
-
 
136
        t_master_affiliate.id = master_affiliate.id
-
 
137
        t_master_affiliate.name = master_affiliate.name
-
 
138
 
-
 
139
    return t_master_affiliate
-
 
140
 
-
 
141
def to_t_affiliate(affiliate):
-
 
142
    t_affiliate = TAffiliate()
-
 
143
    
-
 
144
    if affiliate:
-
 
145
        t_affiliate.id = affiliate.id
-
 
146
        t_affiliate.name = affiliate.name
-
 
147
        t_affiliate.url = affiliate.url
-
 
148
        t_affiliate.masterAffiliateId = affiliate.master_affiliate_id
-
 
149
        
-
 
150
    return t_affiliate
-
 
151
 
-
 
152
def to_t_tracker(tracker):
-
 
153
    t_tracker = TTracker()
-
 
154
    
-
 
155
    if tracker:
-
 
156
        t_tracker.id = tracker.id
-
 
157
        t_tracker.affiliateId = tracker.affiliate_id
-
 
158
 
-
 
159
    return t_tracker
-
 
160
 
-
 
161
def to_t_track_log(track_log):
-
 
162
    t_track_log = TTrackLog()
-
 
163
    
-
 
164
    if track_log:
-
 
165
        t_track_log.id = track_log.id
-
 
166
        t_track_log.trackerId = track_log.tracker_id
-
 
167
        t_track_log.userId = track_log.user_id
-
 
168
        t_track_log.event = track_log.event
-
 
169
        t_track_log.url = track_log.url
-
 
170
        t_track_log.data = track_log.data
-
 
171
 
-
 
172
    return t_track_log
-
 
173
131
174