def z3_user_rating_tuple(object, portal, **kwargs):
    try:
        rated = IUserRating(object)
        return (rated.averageRating, rated.numberOfRatings)
    except (ComponentLookupError, TypeError, ValueError):
        # The catalog expects AttributeErrors when a value can't be found
        raise AttributeError
Ejemplo n.º 2
0
 def __init__(self, context, request):
     self.context = context
     self.request = request
     self.adapted = IUserRating(context)