def is_sub_to_all_kinds(self, *super_entity_kinds):
if super_entity_kinds:<EOL><INDENT>if len(super_entity_kinds) == <NUM_LIT:1>:<EOL><INDENT>has_subset = EntityRelationship.objects.filter(<EOL>super_entity__entity_kind=super_entity_kinds[<NUM_LIT:0>]).values_list('<STR_LIT>', flat=True)<EOL><DEDENT>else:<EOL><INDENT>has_subset = EntityRelationship.objects.filter(<EOL>super_entity__entity_kind__in=super_entity_kinds).values('<STR_LIT>').annotate(<EOL>Count('<STR_LIT>')).filter(super_entity__count=len(set(super_entity_kinds))).values_list(<EOL>'<STR_LIT>', flat=True)<EOL><DEDENT>return self.filter(pk__in=has_subset)<EOL><DEDENT>else:<EOL><INDENT>return self<EOL><DEDENT>
Each returned entity will have superentites whos combined entity_kinds included *super_entity_kinds