Changes between Initial Version and Version 1 of Ticket #29738, comment 6
- Timestamp:
- Sep 15, 2018, 3:13:33 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #29738, comment 6
initial v1 3 3 4 4 {{{ 5 class UnserializablesSerializer(BaseSerializer): 6 def serialize(self): 7 from django.utils.deconstruct import deconstructible 8 deconstructible_value = deconstructible( 9 self.value.__class__, 10 path=self.value.__module__ + "." + self.value.__class__.__name__ 11 ) 12 import pdb 13 pdb.set_trace() 14 self.value = deconstructible_value(self.value.__init__) 15 return DeconstructableSerializer(self.value).serialize() 16 17 5 18 def serializer_factory(value): 6 19 ... 7 20 8 21 9 from django.utils.deconstruct import deconstructible 10 deconstructible_value = deconstructible( 11 value.__class__, 12 path=value.__module__ + "." + value.__class__.__name__ 13 ) 14 value = deconstructible_value(value.__init__) 15 return DeconstructableSerializer(value) 22 if hasattr(value, "__module__") and hasattr(value, "__class__"): 23 return UnserializablesSerializer(value) 16 24 17 25 raise ValueError(...)