def get_all_children(self, include_self=False):
ownership = Ownership.objects.filter(parent=self)<EOL>subsidiaries = Company.objects.filter(child__in=ownership)<EOL>for sub in subsidiaries:<EOL><INDENT>subsidiaries = subsidiaries | sub.get_all_children()<EOL><DEDENT>if include_self is True:<EOL><INDENT>self_company = Company.objects.filter(id=self.id)<EOL>subsidiaries = subsidiaries | self_company<EOL><DEDENT>return subsidiaries<EOL>
Return all subsidiaries of this company.