Changes between Version 2 and Version 3 of Ticket #29738, comment 6


Ignore:
Timestamp:
Sep 16, 2018, 8:06:54 AM (6 years ago)
Author:
Can Sarıgöl

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #29738, comment 6

    v2 v3  
    66    def serialize(self):
    77        from django.utils.deconstruct import deconstructible
    8         deconstructible_value = deconstructible(
     8        deconstructible_klass = deconstructible(
    99            self.value.__class__,
    1010            path=self.value.__module__ + "." + self.value.__class__.__name__
    1111        )
    12         self.value = deconstructible_value(self.value.__init__)
     12        init_values = [v for v in self.value.__reduce__()[2].values()]
     13        self.value = deconstructible_klass(init_values)
    1314        return DeconstructableSerializer(self.value).serialize()
    1415
Back to Top