from changes.api.serializer import Serializer, register
from changes.models.revision import Revision


@register(Revision)
class RevisionSerializer(Serializer):
    def serialize(self, instance, attrs):
        return {
            'id': instance.sha,
            'message': instance.message,
            'author': instance.author,
            'parents': instance.parents,
            'branches': instance.branches,
            'dateCreated': instance.date_created,
        }

from changes.api.serializer import Serializer, register
from changes.models.revision import Revision


@register(Revision)
class RevisionSerializer(Serializer):
    def serialize(self, instance, attrs):
        return {
            'id': instance.sha,
            'sha': instance.sha,
            'message': instance.message,
            'author': instance.author,
            'parents': instance.parents,
            'branches': instance.branches,
            'dateCreated': instance.date_created,
        }

Add sha to revision serializer