コード例 #1
0
ファイル: partial.py プロジェクト: nilbacardit26/plone_prova
 def notifyAdded(self, id):
     """ see interfaces.py """
     assert not id in self.order
     context = aq_base(self.context)
     obj = context._getOb(id)
     if IOrderable.providedBy(obj):
         self.order.append(id)
         self.context._p_changed = True  # the order was changed
コード例 #2
0
 def testGetObjectPositionForNonOrderableContent(self):
     oid = self.folder.invokeFactory('Event', id='foo')
     obj = self.folder._getOb(oid)
     # a non-orderable object should return "no position"
     self.failIf(IOrderable.providedBy(obj), 'orderable events?')
     self.assertEqual(self.folder.getObjectPosition(oid), None)
     # a non-existant object should raise an error, though
     self.assertRaises(ValueError, self.folder.getObjectPosition, 'bar')
コード例 #3
0
 def notifyAdded(self, id):
     """ see interfaces.py """
     assert not id in self.order
     context = aq_base(self.context)
     obj = context._getOb(id)
     if IOrderable.providedBy(obj):
         self.order.append(id)
         self.context._p_changed = True      # the order was changed
コード例 #4
0
 def testGetObjectPositionForNonOrderableContent(self):
     oid = self.folder.invokeFactory('Event', id='foo')
     obj = self.folder._getOb(oid)
     # a non-orderable object should return "no position"
     self.failIf(IOrderable.providedBy(obj), 'orderable events?')
     self.assertEqual(self.folder.getObjectPosition(oid), None)
     # a non-existant object should raise an error, though
     self.assertRaises(ValueError, self.folder.getObjectPosition, 'bar')