コード例 #1
0
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
コード例 #2
0
ファイル: agenda.py プロジェクト: mamazzei/brasil.gov.agenda
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
コード例 #3
0
 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
コード例 #4
0
 def test_next_previous(self):
     self.assertTrue(INextPreviousToggle.providedBy(self.agenda))
コード例 #5
0
 def migrate_nextprevious(self):
     if self.old.getNextPreviousEnabled():
         if INextPreviousToggle.providedBy(self.new):
             self.new.nextPreviousEnabled = True
コード例 #6
0
 def migrate_nextprevious(self):
     if self.old.getNextPreviousEnabled():
         if INextPreviousToggle.providedBy(self.new):
             self.new.nextPreviousEnabled = True
コード例 #7
0
 def test_next_previous(self):
     self.assertTrue(INextPreviousToggle.providedBy(self.agenda))