'Returns the average of all ratings given to this item.'

def ratings_avg(self, item):

    foreign_key = self._foreign_key(self.rating_assoc)
    avg = self.session().query(func.avg(self.rating_assoc.rating)).filter((foreign_key == item)).scalar()
    return (avg or 0.0)
