(self, domain, user_input)
return query
Returns a queryset based on user input
          - Matching happens by name or site-code
          - Adding a slash to the input string starts a new search node among descendants
          - Matching is partial unless the query node is wrapped in quotes
        Refer to TestFilterByUserInput for example usages.
Returns a queryset based on user input
          - Matching happens by name or site-code
          - Adding a slash to the input string starts a new search node among descendants
          - Matching is partial unless the query node is wrapped in quotes
        Refer to TestFilterByUserInput for example usages.
Returns a queryset based on user input - Matching happens by name or site - code - Adding a slash to the input string starts a new search node among descendants - Matching is partial unless the query node is wrapped in quotes Refer to TestFilterByUserInput for example usages .
def filter_by_user_input(self, domain, user_input):
        """
        Returns a queryset based on user input
          - Matching happens by name or site-code
          - Adding a slash to the input string starts a new search node among descendants
          - Matching is partial unless the query node is wrapped in quotes
        Refer to TestFilterByUserInput for example usages.
        """
        query = None
        for part in user_input.split('/'):
            query = self.get_queryset_descendants(query) if query is not None else self
            if part:
                if part.startswith('"') and part.endswith('"'):
                    query = query.filter(name__iexact=part[1:-1])
                else:
                    part = part.lstrip('"')
                    query = query.filter(
                        Q(name__icontains=part) | Q(site_code__icontains=part)
                    )
        return query
def filter_by_user_input ( self , domain , user_input ) : query = None for part in user_input . split ( '/' ) : query = self . get_queryset_descendants ( query ) if query is not None else self if part : if part . startswith ( '"' ) and part . endswith ( '"' ) : query = query . filter ( name__iexact = part [ 1 : - 1 ] ) else : part = part . lstrip ( '"' ) query = query . filter ( Q ( name__icontains = part ) | Q ( site_code__icontains = part ) ) return query