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

option for case insensitivity sorting #626

Open
tarekziade opened this issue Jan 6, 2017 · 4 comments
Open

option for case insensitivity sorting #626

tarekziade opened this issue Jan 6, 2017 · 4 comments

Comments

@tarekziade
Copy link
Contributor

The JSON API spec does not tell if the sorting on string should be case sensitive.

The impact is that the sorting will be case sensitive by default on SA.

It would be great to have an option in flask_restless to allow case insensitive sorting.

See http://stackoverflow.com/a/17567525

I would assume a global config would be sufficient for this behaviour ?

@jfinkels
Copy link
Owner

jfinkels commented Jan 7, 2017

I suppose this makes sense. I'm not sure which is better: a global configuration option or a per-model configuration option. In any case, I'd be willing to review a pull request that adds this. Once you figure out the configuration, you'd place it in the search module, probably here: https://github.com/jfinkels/flask-restless/blob/master/flask_restless/search/drivers.py#L122 (and in the other branch of the if/else as well).

@tarekziade
Copy link
Contributor Author

I'm not sure which is better: a global configuration option or a per-model configuration option

Maybe we could have a global default that can be overwritten at the model-level

@chfw
Copy link

chfw commented Feb 7, 2017

Hi, this use case caught me as well. Our tester flagged it up as a defect because they think the sorting on string terms should be case insensitive. However, flask-restless v0.16.0 does not allow me to do case-insensitive sorting on a particular api endpoint.

@jfinkels
Copy link
Owner

I have started to address this in pull request #631, in which I allow clients to request case-insensitive sorting on a per-request basis. I have not yet enabled server-side configuration of case-insensitive sorting by default.

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

No branches or pull requests

3 participants