def __call__(self): context = aq_inner(self.context) # Old style # context.toggleWatching() # New style watchers = IWatcherList(context) watchers.toggle_watching() self.request.RESPONSE.redirect(context.absolute_url())
def __call__(self): context = aq_inner(self.context) # Old style # context.toggleWatching() # New style watchers = IWatcherList(context) watchers.toggle_watching() self.request.RESPONSE.redirect(context.absolute_url())
def __call__(self): context = aq_inner(self.context) watchers = IWatcherList(context) email = self.request.form.get('email') if email: watchers.watchers.append(email) if self.request.form.get('toggle'): watchers.toggle_watching() # Return the rendered form. return self.index()
def __call__(self): context = aq_inner(self.context) watchers = IWatcherList(context) email = self.request.form.get('email') if email: watchers.watchers.append(email) if self.request.form.get('toggle'): watchers.toggle_watching() # Return the rendered form. return self.index()
def set_task_initial_date(task, event): ''' This subscriber will set the initial date for the task and send email for the author and for the responsible for the task. And create a local role enable responsible to add tasks ''' watchers = IWatcherList(task) watchers.toggle_watching() if task.responsible: watchers.watchers.append(task.responsible) task.manage_setLocalRoles(task.responsible, ['Manager'],) task.initial_date = date.today() send_task_notification_mail(task)
def render(self): context = aq_inner(self.context) watchers = IWatcherList(context) watchers.toggle_watching() self.request.RESPONSE.redirect(context.absolute_url())