Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(2)  |  Derive(0)  |  Import(1)

src/c/o/collective.habla-0.3/collective/habla/browser.py   collective.habla(Download)
from collective.habla import HablaMessageFactory as _
from collective.habla.interfaces import IHablaChat
from Products.CMFCore.utils import getToolByName
from Products.Five import BrowserView
from zope.interface import alsoProvides
    def __call__(self):
        alsoProvides(self.context, IHablaChat)
        plone_utils = getToolByName(self.context, 'plone_utils')
        plone_utils.addPortalMessage(_("The chat has been enabled"))
        self.request.response.redirect(self.context.absolute_url())
    def __call__(self):
        noLongerProvides(self.context, IHablaChat)
        plone_utils = getToolByName(self.context, 'plone_utils')
        plone_utils.addPortalMessage(_("The chat has been disabled"))
        self.request.response.redirect(self.context.absolute_url())