Reputation:
The five.intid documentation states the following pattern for retrieving the IntID for an object:
from five.intid import site
intids = site.get_intids(app.plone)
intid_obj = intids.getId(app.plone.restrictedTraverse('path/to/object')
Is this the canoncical way also in Plone or is there some helper/utility method available wrapping the code above?
Upvotes: 0
Views: 295
Reputation: 1123450
I always use:
from zope.component import getUtility
from zope.intid.interfaces import IIntIds
intid = getUtility(IIntIds).getId(object)
as the intid utility is registered with the local component manager.
Upvotes: 2