'Returns the number of ratings given to this item.'

def ratings_count(self, item):

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