Subversion Repositories SmartDukaan

Rev

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

Rev 6367 Rev 6394
Line 1... Line 1...
1
from shop2020.thriftpy.model.v1.user.ttypes import Address as TAddress, UserCommunication as TUserCommunication, \
1
from shop2020.thriftpy.model.v1.user.ttypes import Address as TAddress, UserCommunication as TUserCommunication, \
2
    User as TUser, Cart as TCart, Line as TLine, MasterAffiliate as TMasterAffiliate, \
2
    User as TUser, Cart as TCart, Line as TLine, MasterAffiliate as TMasterAffiliate, \
3
    Affiliate as TAffiliate, Tracker as TTracker, TrackLog as TTrackLog, Promotion as TPromotion, \
3
    Affiliate as TAffiliate, Tracker as TTracker, TrackLog as TTrackLog, Promotion as TPromotion, \
4
    Coupon as TCoupon, UserNote as TUserNote, Discount as TDiscount, ItemCouponDiscount as TItemCouponDiscount,\
4
    Coupon as TCoupon, Discount as TDiscount, ItemCouponDiscount as TItemCouponDiscount,\
5
    Voucher
5
    Voucher
6
    
6
    
7
from shop2020.utils.Utils import to_java_date
7
from shop2020.utils.Utils import to_java_date
8
 
8
 
9
def to_t_address(address):
9
def to_t_address(address):
Line 189... Line 189...
189
        t_coupon.promotion = to_t_promotion(coupon.promotion)
189
        t_coupon.promotion = to_t_promotion(coupon.promotion)
190
        t_coupon.arguments = coupon.arguments
190
        t_coupon.arguments = coupon.arguments
191
    
191
    
192
    return t_coupon
192
    return t_coupon
193
 
193
 
194
def to_t_user_note(user_note):
-
 
195
    t_user_note = TUserNote()
-
 
196
    
-
 
197
    if user_note:
-
 
198
        t_user_note.user_id = user_note.user_id
-
 
199
        t_user_note.entity_id = user_note.entity_id
-
 
200
        t_user_note.slide = user_note.slide
-
 
201
        t_user_note.note = user_note.note
-
 
202
    
-
 
203
    return t_user_note
-
 
204
 
-
 
205
def to_t_item_coupon_discount(item_coupon_discount):
194
def to_t_item_coupon_discount(item_coupon_discount):
206
    t_item_coupon_discount = TItemCouponDiscount()
195
    t_item_coupon_discount = TItemCouponDiscount()
207
    
196
    
208
    if item_coupon_discount:
197
    if item_coupon_discount:
209
        t_item_coupon_discount.itemId = item_coupon_discount[0]
198
        t_item_coupon_discount.itemId = item_coupon_discount[0]