Ejemplo n.º 1
0
 def set_newsletter_state(self, state):
     if IPossibleNewsletter.providedBy(self.context):
         ifaces = interface.directlyProvidedBy(self.context)
         if state and not INewsletterEnhanced.providedBy(self.context):
             interface.alsoProvides(self.context, INewsletterEnhanced)
         elif not state and INewsletterEnhanced in ifaces:
             interface.directlyProvides(self.context, ifaces - INewsletterEnhanced)
Ejemplo n.º 2
0
 def get_newsletter_state(self):
     if IPossibleNewsletter.providedBy(self.context):
         return INewsletterEnhanced.providedBy(self.context)
     return False