Пример #1
0
 def deserialize_value(self, key, value):
     if key in ['created_at', 'updated_at', 'processed_at', 'closed_at', 'canceled_at',]:
         value = parse_datetime(value) if value else None
     elif key in ['subtotal_price', 'total_line_items_price', 'total_discounts', 'total_price', 'total_price_usd',]:
         value = Decimal(value) if value else None
     else:
         value = value
     return value
Пример #2
0
 def deserialize_value(self, key, value):
     if key in ['created_at',]:
         value = parse_datetime(value) if value else None
     elif key in ['amount',]:
         value = Decimal(value) if value else None
     else:
         value = value
     return value
Пример #3
0
 def deserialize_value(self, key, value):
     if key in ['created_at', 'updated_at',]:
         value = parse_datetime(value) if value else None
     elif key in ['price', 'compare_at_price',]:
         value = Decimal(value) if value else None
     else:
         value = value
     return value
Пример #4
0
 def deserialize_value(self, key, value):
     if key in [
             'created_at',
             'processed_at',
     ]:
         value = parse_datetime(value) if value else None
     else:
         value = value
     return value
Пример #5
0
 def deserialize_value(self, key, value):
     if key in [
             'created_at',
     ]:
         value = parse_datetime(value) if value else None
     elif key in [
             'amount',
     ]:
         value = Decimal(value) if value else None
     else:
         value = value
     return value
Пример #6
0
 def deserialize_value(self, key, value):
     if key in [
             'created_at',
             'updated_at',
     ]:
         value = parse_datetime(value) if value else None
     elif key in [
             'price',
             'compare_at_price',
     ]:
         value = Decimal(value) if value else None
     else:
         value = value
     return value
Пример #7
0
 def deserialize_value(self, key, value):
     if key in [
             'created_at',
             'updated_at',
             'processed_at',
             'closed_at',
             'canceled_at',
     ]:
         value = parse_datetime(value) if value else None
     elif key in [
             'subtotal_price',
             'total_line_items_price',
             'total_discounts',
             'total_price',
             'total_price_usd',
     ]:
         value = Decimal(value) if value else None
     else:
         value = value
     return value
Пример #8
0
 def deserialize_value(self, key, value):
     if key in ['created_at', 'updated_at', 'published_at',]:
         value = parse_datetime(value) if value else None
     else:
         value = value
     return value