def all_tasks(<EOL>self):
self.refresh<EOL>tasksList = []<EOL>for t in self.tasks:<EOL><INDENT>tasksList.append(t)<EOL>subtasks = t.all_tasks()<EOL>tasksList += subtasks<EOL><DEDENT>isProject = False<EOL>try:<EOL><INDENT>this = self.projects<EOL>isProject = True<EOL><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT>if isProject:<EOL><INDENT>for p in self.projects:<EOL><INDENT>subtasks = p.all_tasks()<EOL>tasksList += subtasks<EOL><DEDENT><DEDENT>return tasksList<EOL>
*return a flat list of all tasks contained within this taskpaper object*

        **Return:**
            - ``taskList`` -- a flat list of all tasks

        **Usage:**

            To return a flat list of all tasks recursively found with a taskpaper document object, use the following:

            .. code-block:: python

               allTasks = doc.all_tasks()
               for t in allTasks:
                    print t.title