Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete request for formatted values (suggest + fformatter) #810

Closed
1 task done
Raruto opened this issue Apr 12, 2024 · 0 comments · Fixed by #811
Closed
1 task done

Autocomplete request for formatted values (suggest + fformatter) #810

Raruto opened this issue Apr 12, 2024 · 0 comments · Fixed by #811
Assignees
Labels
feature New feature or request

Comments

@Raruto
Copy link
Contributor

Raruto commented Apr 12, 2024

Checklist

  • I've searched through the current issues to make sure this feature hasn't been requested already.

Motivation

Related to: #787, be able to perfom a request like the following:

https://v37.g3wsuite.it/vector/api/data/qdjango/97/buildings_rating_3d535fae_fd04_4df6_b6ff_8cbd13df078f/?suggest=id_buildings%7Cala&ordering=id_buildings&formatter=1&fformatter=id_buildings

image

// current behavior: "all values are returned"

"data": [
  [1, "Ice Palace"],
  [2, "G3WSUITE"],
  [3, "Garibaldi Palace"],
  [5, "Blue Palace"],
  [6, "Cavour Palace"],
  [7, "Casa Rosada"],
  [8, "Red Building"],
  [9, "G3WSUITE"],
  [10, "Green Palace"],
  [11, "Brown Palace"],
  [12, "White house"],
  [13, "Yellow Palace"],
  [41, "Bob Dylan House"],
  [45, "CasaMia"],
  [46, "fzdg"],
  [51, "Prov Trento"],
  [52, "\\u043a\\u0430\\u043f\\u043a\\u0430\\u043f"],
  [53, "Carnia"],
  [54, "Provincia Lucca"],
  [55, "hfh"],
  [56, "gddg"],
  [57, "Prova mail"],
  [58, "Test mail"],
  [60, "Comune Firenze"],
  [61, "jjjjj"],
  [62, "awrar"],
  [63, "Capannori"],
  [64, "jhgkjgk"],
  [65, "test-ro"],
  [66, "satan star"],
  [67, "Luca"]
]

Suggested solution

Honor the suggest request when combined with fformatter parameter:

// desired behavior: "filter values by 'ala' string"

"data": [
  [1, "Ice Palace"],
  [3, "Garibaldi Palace"],
  [5, "Blue Palace"],
  [6, "Cavour Palace"],
  [10, "Green Palace"],
  [11, "Brown Palace"],
  [13, "Yellow Palace"],
]

PS you should also take in consideration to always perform case insensitive searches for the suggest param (eg. Palace vs palace should not return different results)

Alternatives considered

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants