def get_qset(self, queryset, q):
if self.mongoadmin.search_fields and q:<EOL><INDENT>params = {}<EOL>for field in self.mongoadmin.search_fields:<EOL><INDENT>if field == '<STR_LIT:id>':<EOL><INDENT>if is_valid_object_id(q):<EOL><INDENT>return queryset.filter(pk=q)<EOL><DEDENT>continue<EOL><DEDENT>search_key = "<STR_LIT>".format(field=field)<EOL>params[search_key] = q<EOL><DEDENT>queryset = queryset.filter(**params)<EOL><DEDENT>return queryset<EOL>
Performs filtering against the default queryset returned by
            mongoengine.