Subversion Repositories SmartDukaan

Rev

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

Rev 4295 Rev 4394
Line 5... Line 5...
5
'''
5
'''
6
 
6
 
7
from shop2020.thriftpy.model.v1.order.ttypes import Transaction as T_Transaction,\
7
from shop2020.thriftpy.model.v1.order.ttypes import Transaction as T_Transaction,\
8
    LineItem as T_LineItem, Order as T_Order, Alert as T_Alert, OrderStatus, DelayReason
8
    LineItem as T_LineItem, Order as T_Order, Alert as T_Alert, OrderStatus, DelayReason
9
from shop2020.utils.Utils import to_java_date
9
from shop2020.utils.Utils import to_java_date
10
from shop2020.model.v1.order.impl.DataService import Alerts, Transaction
10
from shop2020.model.v1.order.impl.DataService import Alert, Transaction
11
 
11
 
12
def to_t_transaction(transaction):
12
def to_t_transaction(transaction):
13
    t_transaction = T_Transaction()
13
    t_transaction = T_Transaction()
14
    t_transaction.id = transaction.id
14
    t_transaction.id = transaction.id
15
    t_transaction.createdOn = to_java_date(transaction.createdOn)
15
    t_transaction.createdOn = to_java_date(transaction.createdOn)
Line 112... Line 112...
112
    return t_lineitem
112
    return t_lineitem
113
 
113
 
114
def to_t_alert(alert):
114
def to_t_alert(alert):
115
    t_alert = T_Alert()
115
    t_alert = T_Alert()
116
    t_alert.id = alert.id
116
    t_alert.id = alert.id
117
    t_alert.comment = alert.comment
117
    t_alert.description = alert.description
118
    try:
118
    try:
119
        t_alert.time_set = to_java_date(alert.time_set)
119
        t_alert.timestamp = to_java_date(alert.timestamp)
120
    except:
120
    except:
121
        pass
121
        pass
122
    try:
-
 
123
        t_alert.time_unset = to_java_date(alert.time_unset)
-
 
124
    except:
-
 
125
        pass
-
 
126
    t_alert.order_id = alert.order_id
-
 
127
    t_alert.type = alert.type
122
    t_alert.type = alert.type
-
 
123
    t_alert.status = alert.status
128
    return t_alert
124
    return t_alert