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

Use DRF 3.1 `pagination_class` #3559

Merged
merged 5 commits into from Feb 15, 2018

Conversation

Projects
None yet
3 participants
@humitos
Member

humitos commented Jan 27, 2018

Closes #3251

@humitos humitos referenced this pull request Jan 27, 2018

Merged

Style using pre-commit #3560

@humitos

This comment has been minimized.

Member

humitos commented Jan 27, 2018

@ericholscher @agjohnson since we were talking that mixing style and logic PR is kind of tedious, I created another PR based on this where I ran pre-commit on the modified files and tweaked a little manually.

Let me know if you like this approach. It a little tedious to make two different PR but I hope it simplies the review.

@safwanrahman

This comment has been minimized.

Member

safwanrahman commented Jan 28, 2018

I think, rather than fixing from the backend, this should be controlled by page_size parameter from the frontend. what do you think @humitos ?

@humitos

This comment has been minimized.

Member

humitos commented Jan 29, 2018

@safwanrahman good catch!

I think it's a good idea. I'd like to fix the bug and make it work as it was working before since it could be other places that use that endpoint and may rely on that pagination size also.

From #3251

I think there should be a button in the UI for going next

Yes, we should think in a non-intrusive UI design for this. Most of the users won't have more than 25 organizations (in fact we have just one report of a person having 11 :) ).

But anyway, I agree with both suggestions but I'd like to make them in different PR.

If you agree with me, would you mind openning these two issues? Thanks!

@ericholscher

Looks good to me for the immediate fix. We can let users set a page size in the future, but at least having working pagination is a good step :)

Might be useful to include a test, so that if it breaks again, we'll know.

ericholscher and others added some commits Jan 30, 2018

for _ in range(100):
get(Project)
resp = self.client.get('/api/v2/project/')

This comment has been minimized.

@safwanrahman

safwanrahman Feb 13, 2018

Member

I think you can get the url by using reverse. So it will be easier to manage in the future

@safwanrahman

Looks good.
I have a minor correction, but its ok to ignore that and handle in future

@safwanrahman safwanrahman merged commit e6f1c54 into master Feb 15, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@stsewd stsewd deleted the humitos/import/organization branch Aug 15, 2018

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