def encode_blob(value):
    """Encode a blob, this is actually a link which
	may point to an S3 location"""
    from StringIO import StringIO
    ret = {'__type__': '__blob__'}
    if not isinstance(value.file, StringIO):
        ret['__href__'] = value.file.generate_url(3600)
    return ret
