Skip to content

Remove Django filters #2635

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

Closed
agjohnson opened this issue Feb 7, 2017 · 11 comments
Closed

Remove Django filters #2635

agjohnson opened this issue Feb 7, 2017 · 11 comments

Comments

@agjohnson
Copy link
Contributor

We aren't using Django Filters project anymore, this dependency should be removed. This will require some updates to the code where it is expected.

@agjohnson agjohnson added Good First Issue Good for new contributors Sprintable Small enough to sprint on labels Feb 7, 2017
@ericholscher
Copy link
Member

I believe it's used in REST Framework, but the in page filters aren't being used. It broke our pagination on Builds in #2633, so it might also be breaking other stuff, and is unnecessary complexity.

@vardhan26
Copy link

I would like to fix this bug but I am new and do not know how to start. how can I fix this?

@humitos
Copy link
Member

humitos commented Feb 17, 2017

@vardhan26 I started today to take a look at the code, but what I would do is something like:

  1. read this http://docs.readthedocs.io/en/latest/contribute.html
  2. install readthedocs project in my computer following http://docs.readthedocs.io/en/latest/install.html#installing-read-the-docs
  3. remove django-filter (pip uninstall django-filter)
  4. run tests (python manage.py test)
  5. see what fails
  6. try to fix them
  7. runserver (python manage.py runserver)
  8. try to build different projects again (python manage.py update_repos pip)
  9. create a PR
  10. be happy to be a contributor :)

@ChamanAgrawal
Copy link

ChamanAgrawal commented Mar 8, 2017

hey @agjohnson , @humitos do i have to debug all the 174 errors and 25 failures and then send PR or I can debug few and contribute ?

@rixx
Copy link
Contributor

rixx commented Mar 9, 2017

@vardhan26, @humitos, @ChamanAgrawal: are you working on this issue atm?

@humitos
Copy link
Member

humitos commented Mar 9, 2017

@rixx No, I'm not. Would you like to?

I would like to fix my previous command to run the tests: tox -e py27, since they are using tox in RTD :)

@rixx
Copy link
Contributor

rixx commented Mar 9, 2017

@agjohnson

I found the following uses of django_filters:

  • core.urls uses views from django_filters.views in deprecated_urls; I assume those are to be deleted?
  • projects.filters and builds.filters define lots of filters that are used as filter_class in restapi.views.model_views, and are passed as context sometimes in projects.views.public

I'd appreciate guidance as to what to do with those, especially those used in restapi.views.model_filters and projects.views.public.

fmoor added a commit to fmoor/readthedocs.org that referenced this issue May 23, 2017
@agjohnson agjohnson reopened this Jun 5, 2017
@agjohnson agjohnson added Next Release and removed Good First Issue Good for new contributors Sprintable Small enough to sprint on labels Jun 5, 2017
@JLorne
Copy link
Contributor

JLorne commented Jul 13, 2017

Sorry to write a comment in a closed issue, but I don't know where to put it.

We are using readthedocs as our documentation build system and we are using the REST API to monitoring the build status of the different versions of our repositories. Now that you removed django-filter, do you have another way to use the REST API without having to parse all builds from the beginning of time?

@davidfischer
Copy link
Contributor

@JLorne while going through some of these issues I found this. It is now possible to filter builds by project. For example, you can do something like https://readthedocs.org/api/v2/build/?project__slug=pip (that's a double underscore). Hopefully this meets your needs.

APIv2 is also now documented. Since the RTD team is going through some initial design on a v3 API, I'd love to understand your use case a bit better so we can better meet it.

@JLorne
Copy link
Contributor

JLorne commented Jul 7, 2018

Thank you @davidfischer for the filterable v2 API.
We are using it to monitor documentation build status for our 160 internal repositories and display build fail on TV. But we need to keep track of the build status of some versions in addition of the latest. I add a custom API that add build API with some query parameters:

  • api/build?slug=pip&version=v9.0.3 => returns all pip v9.0.3 builds ordered by dates (latest first)

@davidfischer
Copy link
Contributor

Currently only the slug is used for filtering. For performance reasons, we wanted to make sure that things you can filter on are indexed in the database. I don't believe the version parameter in https://readthedocs.org/api/v2/build/?project__slug=pip&version=v9.0.3 does anything.

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

8 participants