Пример #1
0
    def add_child(self, tid):
        """Add a subtask to this task

        @param child: the added task
        """
        Log.debug("adding child %s to task %s" % (tid, self.get_id()))
        self.can_be_deleted = False
        # the core of the method is in the TreeNode object
        TreeNode.add_child(self, tid)
        # now we set inherited attributes only if it's a new task
        child = self.req.get_task(tid)
        if self.is_loaded() and child and child.can_be_deleted:
            child.set_start_date(self.get_start_date())
            child.set_due_date(self.get_due_date())
            for t in self.get_tags():
                child.add_tag(t.get_name())
        self.sync()
        return True
Пример #2
0
Файл: task.py Проект: snoord/gtg
    def add_child(self, tid):
        """Add a subtask to this task

        @param child: the added task
        """
        log.debug(f"adding child {tid} to task {self.get_id()}")
        self.can_be_deleted = False
        # the core of the method is in the TreeNode object
        TreeNode.add_child(self, tid)
        # now we set inherited attributes only if it's a new task
        child = self.req.get_task(tid)
        if self.is_loaded() and child and child.can_be_deleted:
            child.set_start_date(self.get_start_date())
            child.set_due_date(self.get_due_date())
            for t in self.get_tags():
                child.add_tag(t.get_name())
        self.sync()
        return True
Пример #3
0
    def add_child(self, tid):
        """Add a subtask to this task

        @param child: the added task
        """
        log.debug("adding child %s to task %s", tid, self.get_id())
        self.can_be_deleted = False
        # the core of the method is in the TreeNode object
        TreeNode.add_child(self, tid)
        # now we set inherited attributes only if it's a new task
        child = self.req.get_task(tid)
        if self.is_loaded() and child and child.can_be_deleted:
            # If the the child is repeating no need to change the date
            if not child.get_recurring():
                child.set_start_date(self.get_start_date())
                child.set_due_date(self.get_due_date())
            for t in self.get_tags():
                child.add_tag(t.get_name())

            child.inherit_recursion()

        self.sync()
        return True
Пример #4
0
 def add_child(self, child_id):
     special_child = self.req.get_tag(child_id).is_special()
     if not self.is_special() and not special_child:
         TreeNode.add_child(self, child_id)
Пример #5
0
 def add_child(self, child_id):
     special_child = self.req.get_tag(child_id).is_special()
     if not self.is_special() and not special_child:
         TreeNode.add_child(self, child_id)