def _attach_fields(self, obj, data, field_names):
        for field_name in field_names:
            value = data.get(field_name, None)
            if field_name in self.datetime_fields and value:
                value = self.handle_date(value)
            setattr(obj, field_name, value)
        return obj
Attach fields to fake instance.
dataset/ETHPy150Open mozilla/addons-server/src/olympia/api/serializers.py/BaseESSerializer._attach_fields