L 1 년 전
부모
커밋
c44e3716cd
1개의 변경된 파일33개의 추가작업 그리고 4개의 파일을 삭제
  1. 33 4
      jsonAndRequest.py

+ 33 - 4
jsonAndRequest.py

@@ -44,15 +44,44 @@ import requests
 
 
 class Order(object):
-    def __init__(self, ticket, state):
+    def __init__(self, ticket, state, id_metaservice, is_global, is_visible, service, service_type, time_placed, time_start, time_start_predicted, time_finish_predicted, time_start_real, time_finish_real, order_place_start, order_place_start_gps, order_place_start_real, order_place_start_real_gps, order_place_finish_predicted, order_place_finish_predicted_gps, order_place_finish_real, order_place_finish_real_gps, predicted_price, real_price, payment_transaction_id, rating_id, provider, provider_screen_name, receiver, receiver_screen_name, client_id, resource_id):
         self.ticket = ticket
         self.state = state
+        self.id_metaservice = id_metaservice
+        self.is_global = is_global
+        self.is_visible = is_visible
+        self.service = service
+        self.service_type = service_type
+        self.time_placed = time_placed
+        self.time_start = time_start
+        self.time_start_predicted = time_start_predicted
+        self.time_finish_predicted = time_finish_predicted
+        self.time_start_real = time_start_real
+        self.time_finish_real = time_finish_real
+        self.order_place_start = order_place_start
+        self.order_place_start_gps = order_place_start_gps
+        self.order_place_start_real = order_place_start_real
+        self.order_place_start_real_gps = order_place_start_real_gps
+        self.order_place_finish_predicted = order_place_finish_predicted
+        self.order_place_finish_predicted_gps = order_place_finish_predicted_gps
+        self.order_place_finish_real = order_place_finish_real
+        self.order_place_finish_real_gps = order_place_finish_real_gps
+        self.predicted_price = predicted_price
+        self.real_price = real_price
+        self.payment_transaction_id = payment_transaction_id
+        self.rating_id = rating_id
+        self.provider = provider
+        self.provider_screen_name = provider_screen_name
+        self.receiver = receiver
+        self.receiver_screen_name = receiver_screen_name
+        self.client_id = client_id
+        self.resource_id = resource_id
+
         #доделать до конца по аналогии с закоммиченным json
-    
     def __str__(self):
-        return "{0}, {1},\n".format(self.ticket, self.state)
+        return "{0}, {1}, {2}, {3}, {4}, {5}, {6},\n{7}, {8}, {9}, {10}, {11}, {12},\n{13}, {14}, {15}, {16}, {17}, {18}, {19}, {20},\n{21}, {22}, {23}, {24},\n{25}, {26}, {27}, {28}, {29}, {30}".format(self.ticket, self.state, self.id_metaservice, self.is_global, self.is_visible, self.service, self.service_type, self.time_placed, self.time_start, self.time_start_predicted, self.time_finish_predicted, self.time_start_real, self.time_finish_real, self.order_place_start, self.order_place_start_gps, self.order_place_start_real, self.order_place_start_real_gps, self.order_place_finish_predicted, self.order_place_finish_predicted_gps, self.order_place_finish_real, self.order_place_finish_real_gps, self.predicted_price, self.real_price, self.payment_transaction_id, self.rating_id,  self.provider, self.provider_screen_name, self.receiver, self.receiver_screen_name, self.client_id, self.resource_id)
         #\n добавляете в местах с пустой строкой в шаблоне
-
+        
 #Функция преобразования json в объект класса 
 def jsonToClass(jsonstring) -> Order:
     jsonObj = json.loads(jsonstring)