'compute the mimetype of the given values
:param values : dict of values to create or write an ir_attachment
:return mime : string indicating the mimetype, or application/octet-stream by default'

def _compute_mimetype(self, values):

    mimetype = None
    if values.get('mimetype'):
        mimetype = values['mimetype']
    if ((not mimetype) and values.get('datas_fname')):
        mimetype = mimetypes.guess_type(values['datas_fname'])[0]
    if ((not mimetype) and values.get('url')):
        mimetype = mimetypes.guess_type(values['url'])[0]
    if (values.get('datas') and ((not mimetype) or (mimetype == 'application/octet-stream'))):
        mimetype = guess_mimetype(values['datas'].decode('base64'))
    return (mimetype or 'application/octet-stream')
