Did I find the right examples for you? yes no

All Samples(3)  |  Call(0)  |  Derive(0)  |  Import(3)
Rulesets are registered for entities, which can be a type or an interface.
This means the lookup mechanism needs to be aware of all of those and deal
with things like derived classes as well. Luckily we have a framework which
already implements that: zope.component.

We will (ab)use the zope.component registries by registering a dummy adapter
for the entity to a special ICacheRule interface and which will always return
the ruleset id.

src/p/l/plone.caching-1.0/plone/caching/tests/test_lookup.py   plone.caching(Download)
 
from z3c.caching.registry import RulesetRegistry
import z3c.caching.registry
 
from plone.caching.lookup import DefaultRulesetLookup

src/p/l/plone.caching-1.0/plone/caching/tests/test_hooks.py   plone.caching(Download)
 
from z3c.caching.registry import RulesetRegistry
import z3c.caching.registry
 
from plone.registry.interfaces import IRegistry

src/p/l/plone.app.caching-1.2.1/plone/app/caching/tests/test_lookup.py   plone.app.caching(Download)
import unittest2 as unittest
from plone.testing.zca import UNIT_TESTING
 
from z3c.caching.registry import RulesetRegistry
import z3c.caching.registry