Explorar el Código

update serializer 1

kateshev14 hace 5 meses
padre
commit
4fb0159955
Se han modificado 1 ficheros con 11 adiciones y 11 borrados
  1. 11 11
      serializer/orders_local.py

+ 11 - 11
serializer/orders_local.py

@@ -52,17 +52,17 @@ class OrdersLocalSerializer(serializers.ModelSerializer):
     #due_date = serializers.DateField(source="order_synced.ticket.due_date", allow_null=True)
     #status_changed_date = serializers.DateTimeField(source="order_synced.ticket.status_changed_date", allow_null=True)
     # order_synced = OrdersSerializer(read_only=True)
-    service_date = serializers.DateTimeField(null=True)
-    service_time = serializers.TimeField(null=True)
-    discription = serializers.CharField(null=True, max_length=300)
-    price = serializers.IntegerField(null=True)   
-    name_order = serializers.CharField(null=True, max_length=300)
-    comment = serializers.CharField(null=True, max_length=300, default="-")
-    place_start = serializers.CharField(null=True, max_length=100)
-    place_end = serializers.CharField(null=True, max_length=100)
-    guide_type = serializers.IntegerField(null=True)
-    movement_way = serializers.IntegerField(null=True)
-    numb_of_people = serializers.IntegerField(null=True)
+    service_date = serializers.DateTimeField(source="order_synced.service_date", allow_null=True)
+    service_time = serializers.TimeField(source="order_synced.service_time", allow_null=True)
+    discription = serializers.CharField(source="order_synced.discription", allow_null=True)
+    price = serializers.IntegerField(source="order_synced.price", allow_null=True)   
+    name_order = serializers.CharField(source="order_synced.name_order", allow_null=True)
+    comment = serializers.CharField(source="order_synced.comment", allow_null=True)
+    place_start = serializers.CharField(source="order_synced.place_start", allow_null=True)
+    place_end = serializers.CharField(source="order_synced.place_end", allow_null=True)
+    guide_type = serializers.IntegerField(source="order_synced.guide_type", allow_null=True)
+    movement_way = serializers.IntegerField(source="order_synced.movement_way", allow_null=True)
+    numb_of_people = serializers.IntegerField(source="order_synced.numb_of_people", allow_null=True)
 
     class Meta:
         model = OrdersLocal