'compute the number of starred of the current user'

@api.model
def get_starred_count(self):

    if self.env.user.partner_id:
        self.env.cr.execute('\n                                                                SELECT    count(*)    as    starred_count\n                                                                FROM    mail_message_res_partner_starred_rel    R\n                                                                WHERE    R.res_partner_id    =    %s    ', (self.env.user.partner_id.id,))
        return self.env.cr.dictfetchall()[0].get('starred_count')
    _logger.error('Call    to    starred_count    without    partner_id')
    return 0
