-
Notifications
You must be signed in to change notification settings - Fork 301
Pagination of nested relationships #178
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
Comments
Here is what I found regarding implementation: http://stackoverflow.com/questions/15617595/paginate-relationship-in-django-rest-framework. |
Based on that stackoverflow the first thing I would suggest trying is |
You mean an in-house implementation? I was thinking of maybe a generic implementation for the package. What I had in mind was:
So I was think how hard it would be to achieve something like this and how you look at that type of functionality being in the package. It just looks like functionality that anyone who has more than 20 relations per object would probably want. |
I meant in-house implementation in case you needed it right now. We would like to see a proper solution in this package so if you feel to contribute it would be most welcome. @jsenecal and I had discussed the setting approach and if I remember right we decided it would work well but haven't had time to implement yet. It seems to me like pagination styles should be uniform across the API so perhaps the main pagination class ( |
Should be possible if it doesn't break everyones API structure as soon as they upgrade, will take a look. Btw, can you explain why the master branch is so behind develop? Because I'm using latest Django 1.9 & DRF 3.3.2 and can only use the develop branch of this package for my project. |
This adapter was originally written for Ember Data and then turned into JSON API spec (so did Ember) so the master branch is there for legacy reasons. Very soon I plan to tag a beta version and we can keep a changelog/upgrade guide from then on. |
Ah, ok, was just confusing, since it's usually the other way around, the legacy/snapshot code is in a different branch and master is the latest stable. |
So I looked at possible ways to implement this. Because we obviously can't do it on the view level there are only 2 places this can be done: the serializer field responsible for the relations or directly in the renderer. The 1st approach is much cleaner, but is not passible due to Looks like it boils down to the decision on where to put the overhead, on the users having to extend from a custom serializer, or the package developers implementing pretty much all the logic in renderer.. |
I expect everyone to import |
So I was off on a Christmas vacation for a while, but will try to take a fresh look at this now :) |
I don't know if it would be useful for this issue or not, but there is a |
Heys guys, |
so this seems to be fixed by this #445 and could be closed. thanks for the great work |
Hello, recently started playing with this package, and while I am a bit struggling with somewhat scarce documentation, I really love the idea and how it works.
One of the quirks I have is how to paginate nested relationships. My data can easily reach thousands of relations per object and that sometimes just hangs the server/browser.
I read the spec and found out that it is possible to have the server paginate also the internal relationships.
I would guess that this is not implemented yet? If not, can you evaluate on how hard it would be to do something like this and maybe point me in the right direction on where to start?
The text was updated successfully, but these errors were encountered: