'Returns all templates that include this one, recursively.  (starting
with this one)'

def related_templates(self):

    try:
        return self._related_templates
    except AttributeError:
        pass
    retval = set([self])
    for t in self.all_templates:
        if t.includes_template(self):
            retval = retval.union(t.related_templates())
    self._related_templates = retval
    return retval
