Exemplo n.º 1
0
 def findByIds(self, ids):
     """Do a find for the `ids` listed in `ids`, which is a string."""
     finder = IFind(self.context)
     ids = ids.split()
     # if we don't have any ids listed, don't search at all
     if not ids:
         return []
     request = self.request
     result = []
     for object in finder.find([SimpleIdFindFilter(ids)]):
         url = zapi.absoluteURL(object, request)
         result.append({ 'id': getName(object), 'url': url})
     return result
Exemplo n.º 2
0
 def testGetNameOfRoot(self):
     from zope.app.traversing.api import getName
     self.assertEqual(
         getName(self.root),
         u'',
         )
Exemplo n.º 3
0
 def testGetName(self):
     from zope.app.traversing.api import getName
     self.assertEqual(
         getName(self.item),
         'item'
         )