def hook_get_queryset(self, changelist, request):
changelist.check_field_exists(self.left_field)<EOL>changelist.check_field_exists(self.right_field)<EOL>self.pid = self.get_pid_from_request(changelist, request)<EOL>qs = changelist.root_queryset<EOL>if self.pid:<EOL><INDENT>self.parent = qs.get(pk=self.pid)<EOL>changelist.params.update(self.get_immediate_children_filter(self.parent))<EOL><DEDENT>else:<EOL><INDENT>changelist.params[self.level_field] = self.root_level<EOL>self.parent = qs.get(**{key: val for key, val in changelist.params.items() if not key.startswith('<STR_LIT:_>')})<EOL><DEDENT>
Triggered by `ChangeList.get_queryset()`.