Пример #1
0
 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())
Пример #2
0
 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())
Пример #3
0
 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()
Пример #4
0
 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)
Пример #6
0
 def render(self):
     context = aq_inner(self.context)
     watchers = IWatcherList(context)
     watchers.toggle_watching()
     self.request.RESPONSE.redirect(context.absolute_url())