'Returns the integer rating given to this item by the user.
Returns the full rating model if `as_int` is False.'

def rating(self, item, user, as_int=True):

    rating = self.query_associated(self.rating_assoc, item).filter_by(user=user).first()
    if (not as_int):
        return rating
    return (rating.rating if (rating is not None) else None)
