old_contents: from changes.api.serializer import Serializer, register
  from changes.models import Source
  
  
  @register(Source)
  class SourceSerializer(Serializer):
      def serialize(self, instance, attrs):
          if instance.patch_id:
              patch = {
                  'id': instance.patch_id.hex,
              }
          else:
              patch = None
  
          return {
              'id': instance.id.hex,
              'patch': patch,
              'revision': instance.revision,
              'dateCreated': instance.date_created,
          }
  
new_contents: from changes.api.serializer import Serializer, register
  from changes.models import Source
  
  
  @register(Source)
  class SourceSerializer(Serializer):
      def serialize(self, instance, attrs):
          if instance.patch_id:
              patch = {
                  'id': instance.patch_id.hex,
              }
          else:
              patch = None
  
          return {
              'id': instance.id.hex,
              'patch': patch,
              'revision': instance.revision,
              'dateCreated': instance.date_created,
              'tails_data': dict(instance.data),
          }
  
subject: Add data to Source serialization