Changes between Version 3 and Version 4 of Ticket #29738, comment 6
- Timestamp:
- Sep 16, 2018, 10:05:18 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #29738, comment 6
v3 v4 4 4 {{{ 5 5 class UnserializablesSerializer(BaseSerializer): 6 def serialize(self):6 def serialize(self): 7 7 from django.utils.deconstruct import deconstructible 8 8 deconstructible_klass = deconstructible( … … 10 10 path=self.value.__module__ + "." + self.value.__class__.__name__ 11 11 ) 12 init_values = [v for v in self.value.__reduce__()[2].values()] 13 self.value = deconstructible_klass(init_values) 14 return DeconstructableSerializer(self.value).serialize() 15 12 init_values = self.value.__reduce__() 13 new_value = deconstructible_klass() 14 if len(init_values) > 2: 15 new_value = deconstructible_klass(*[v for v in init_values[2].values()]) 16 return DeconstructableSerializer(new_value).serialize() 16 17 17 18 def serializer_factory(value):