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

Use DRF 3.1 pagination_class #3559

Merged
merged 5 commits into from
Feb 15, 2018
Merged

Conversation

humitos
Copy link
Member

@humitos humitos commented Jan 27, 2018

Closes #3251

@humitos humitos mentioned this pull request Jan 27, 2018
@humitos
Copy link
Member Author

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
Copy link
Member

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
Copy link
Member Author

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!

Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

for _ in range(100):
get(Project)

resp = self.client.get('/api/v2/project/')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

@safwanrahman safwanrahman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@stsewd stsewd deleted the humitos/import/organization branch August 15, 2018 22:15
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

Successfully merging this pull request may close these issues.

3 participants