Example #1
0
 def cart_folder(self):
     context = aq_inner(self.context)
     while not [
             obj for obj in aq_parent(context).objectValues()
             if ICartFolderContentType.providedBy(obj)
     ]:
         context = aq_parent(context)
     return [
         obj for obj in aq_parent(context).objectValues()
         if ICartFolderContentType.providedBy(obj)
     ][0]
Example #2
0
 def cart_folder(self):
     context = aq_inner(self.context)
     chains = [obj for obj in aq_chain(context) if hasattr(obj, 'Type')]
     if len(chains) != 1:
         chains = chains[1:]
     for obj in chains:
         for ob in obj.objectValues():
             if ICartFolderContentType.providedBy(ob):
                 return ob
Example #3
0
 def cart_folder(self):
     context = aq_inner(self.context)
     chains = [obj for obj in aq_chain(context) if hasattr(obj, 'Type')]
     if len(chains) != 1:
         chains = chains[1:]
     for obj in chains:
         for ob in obj.objectValues():
             if ICartFolderContentType.providedBy(ob):
                 return ob
 def test_interface(self):
     from collective.cart.core.interfaces import ICartFolderContentType
     item = self.createCartFolder()
     self.assertTrue(ICartFolderContentType.providedBy(item))
 def test_interface(self):
     from collective.cart.core.interfaces import ICartFolderContentType
     item = self.createCartFolder()
     self.assertTrue(ICartFolderContentType.providedBy(item))
Example #6
0
 def cart_folder(self):
     context = aq_inner(self.context)
     while not [obj for obj in aq_parent(context).objectValues() if ICartFolderContentType.providedBy(obj)]:
         context = aq_parent(context)
     return [obj for obj in aq_parent(context).objectValues() if ICartFolderContentType.providedBy(obj)][0]