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

Unable to sort and filter JSON fields #247

Open
dalenhughes opened this issue Aug 20, 2018 · 6 comments
Open

Unable to sort and filter JSON fields #247

dalenhughes opened this issue Aug 20, 2018 · 6 comments

Comments

@dalenhughes
Copy link

dalenhughes commented Aug 20, 2018

I'm looking to expand the functionality to handle sorting and filtering for JSON field data.

Would like this to work using PostgresSQL database's built-in jsonb object which allows indexing. Would involve augmenting one of the models to include nested JSON. Here are the options I came up with:

  1. Treat the JSON field like a text field
  2. Convert the tests to Postgres
  3. Test two configurations, one with sqlite, one with postgres
  4. We could maintain a fork of the project

https://docs.djangoproject.com/en/2.1/ref/contrib/postgres/fields/

@dalenhughes
Copy link
Author

dalenhughes commented Aug 20, 2018

thoughts? @ryochiji

dalenhughes added a commit to dalenhughes/dynamic-rest that referenced this issue Aug 31, 2018
@joshvillbrandt
Copy link
Contributor

joshvillbrandt commented Aug 31, 2018

Hi @AltSchool team, I'm working with @dalenhughes on this feature. @dalenhughes has this up and running on a branch and we've opened a pull request. The branch is able to do deep filtering and sorting on jsonb field types.

As @dalenhughes mentioned above, the primary outstanding element with this change is figuring out how to test this feature since it depends on JSON field types. JSON fields, however, aren't supported with sqlite which is the database implementation used in the dynamic-rest types. Our best ideas for testing so far are:

  1. Utilize an extension (via requirements.test.txt only) to add a json field type to sqlite; this needs more research as such a package might not exist
  2. Convert the tests to postgres

Do you guys have a preference of approach? Can you think of an easier way to test this feature? Is this a feature you'd be interested in supporting in dynamic-rest in the first place? Please let us know.

(PS: Thanks again for your continued support of this repo!!)

dalenhughes added a commit to dalenhughes/dynamic-rest that referenced this issue Sep 5, 2018
@joshvillbrandt
Copy link
Contributor

Ping @ryochiji, @atzannes, @DeviateFish - would someone mind reviewing our request? We'd like to get this merged so that we aren't maintaining a separate fork.

Thanks for your time and support!

@atzannes
Copy link
Contributor

atzannes commented Oct 4, 2018

Hey @joshvillbrandt and @dalenhughes, thank you for your interest in the project. Unfortunately, I'm not very knowledgeable and will defer to Ryo. I contacted him and it's on his radar to reply to you as soon as he finds some time. Apologies for the slow turn-around.

@joshvillbrandt
Copy link
Contributor

Awesome. Thanks for the update! :)

mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 7, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 7, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 7, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 8, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 9, 2022
@mattmendivil
Copy link

@aleontiev @suavesav and @chdastolfo I have a draft PR up for fixing this issue- I'm having some issues running tests locally so I'd like to utilize the workflows that are automatically run on PRs.

Could one of you approve running the workflow on this PR?

Thanks!

mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Nov 30, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Dec 1, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Dec 2, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Dec 2, 2022
mattmendivil pushed a commit to mattmendivil/dynamic-rest that referenced this issue Dec 5, 2022
mattmendivil added a commit to mattmendivil/dynamic-rest that referenced this issue Dec 8, 2022
allow for sorting/filtering of JSON objects when using PostgreSQL AltSchool#247
mdylanbell pushed a commit to mdylanbell/dynamic-rest-stellar that referenced this issue Apr 11, 2024
mdylanbell pushed a commit to mdylanbell/dynamic-rest-stellar that referenced this issue Apr 11, 2024
mdylanbell pushed a commit to mdylanbell/dynamic-rest-stellar that referenced this issue Apr 11, 2024
mdylanbell pushed a commit to mdylanbell/dynamic-rest-stellar that referenced this issue Apr 15, 2024
mdylanbell pushed a commit to mdylanbell/dynamic-rest-stellar that referenced this issue Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants