'Fetch content from file or database'

def _fetch_content(self):

    try:
        self.stat()
        if self._filename:
            with open(self._filename, 'rb') as fp:
                return fp.read().decode('utf-8')
        else:
            return self._ir_attach['datas'].decode('base64').decode('utf-8')
    except UnicodeDecodeError:
        raise AssetError(('%s    is    not    utf-8    encoded.' % self.name))
    except IOError:
        raise AssetNotFound(('File    %s    does    not    exist.' % self.name))
    except:
        raise AssetError(('Could    not    get    content    for    %s.' % self.name))
