from changes.api.serializer import Serializer, register
from changes.models.log import LogSource


@register(LogSource)
class LogSourceSerializer(Serializer):
    def serialize(self, instance, attrs):
        return {
            'id': instance.id.hex,
            'job': {
                'id': instance.job_id.hex,
            },
            'name': instance.name,
            'step': instance.step,
            'dateCreated': instance.date_created,
        }

[((5, 1, 5, 20), 'changes.api.serializer.register', 'register', ({(5, 10, 5, 19): 'LogSource'}, {}), '(LogSource)', False, 'from changes.api.serializer import Serializer, register\n')]