def habilita_next_previous(event, obj=None): """ Ordenacao por id dentro de uma agenda """ if not obj: obj = event.object if not IAgenda.providedBy(obj): # nao eh uma agenda return behavior = INextPreviousToggle(obj) behavior.nextPreviousEnabled = True
def migrate_nextprevious(self): try: enabled = self.old.getNextPreviousEnabled() except AttributeError: # The old type may not have this. # https://github.com/plone/plone.app.contenttypes/issues/582 return if enabled and INextPreviousToggle.providedBy(self.new): self.new.nextPreviousEnabled = True
def test_next_previous(self): self.assertTrue(INextPreviousToggle.providedBy(self.agenda))
def migrate_nextprevious(self): if self.old.getNextPreviousEnabled(): if INextPreviousToggle.providedBy(self.new): self.new.nextPreviousEnabled = True