Filter queryset by name, with word wide auto-completion

def by_name(queryset, name=None):
  """ Filter queryset by name, with word wide auto-completion """
  if name:
    queryset = queryset.filter(name=name)
  return queryset