encode / django-rest-framework

Web APIs for Django. 🎸
https://www.django-rest-framework.org
Other
28.46k stars 6.85k forks source link

Version 3.1 #1169

Closed tomchristie closed 9 years ago

tomchristie commented 11 years ago

Link to draft release announcement

Headline features include:


Required

Optional

jacobg commented 11 years ago

How might a cursor-based pagination implementation work in these upcoming improvements?

Facebook SDK page has a good description: https://developers.facebook.com/docs/reference/api/pagination/

And here is a solution for Django nonrel: https://github.com/potatolondon/potatopage?source=c http://p.ota.to/blog/2013/04/pagination-with-cursors-in-the-app-engine-datastore/

tomchristie commented 11 years ago

How might a cursor-based pagination implementation work in these upcoming improvements?

The pagination API should be able to support cursor style paginations as well as numbered paging, but we not actually provide those implementations.

thedrow commented 11 years ago

Please don't make implementers deal with trivial (and possibly non-trivial) features over and over again. If you are going to drop the numbered paging implementation that would be bad for the community and the project.

tomchristie commented 11 years ago

If you are going to drop the numbered paging implementation

There's no plan for that to happen.

thedrow commented 11 years ago

@tomchristie Sorry I misunderstood you then. What did you mean?

tomchristie commented 11 years ago

I meant to say that we might not necessarily provide any extra implementations in addition to the existing style.

On 3 November 2013 14:12, Omer Katz notifications@github.com wrote:

@tomchristie https://github.com/tomchristie Sorry I misunderstood you then. What did you mean?

— Reply to this email directly or view it on GitHubhttps://github.com/tomchristie/django-rest-framework/issues/1169#issuecomment-27645242 .

ghost commented 10 years ago

not saying it's a great idea, but as an immediate workaround if you need (or at least want) e.g. limit/offset (Of course people are moving to opaque cursor, limit/offset is just an example) note you can e.g. apply them directly as a bodged django-filter rather than a paginator as in e.g. https://gist.github.com/dgoldensquared/8668831#file-limoff-py

This has an interesting (and conceivably useful) effect the existing oldschool pagination is then applied within the limited/offset results.

iorlas commented 10 years ago

I guess, not planned on DRF 2? >_>

tomchristie commented 10 years ago

I guess, not planned on DRF 2

Improving the pagination API is still very much on the roadmap, yup! See the first stretch goal, here... https://www.kickstarter.com/projects/tomchristie/django-rest-framework-3

tomchristie commented 10 years ago

Note that this ticket should include addressing #1538 if necessary.

livenson commented 10 years ago

We have implemented pagination support to use headers instead of modifying the output - https://github.com/opennode/nodeconductor/blob/develop/nodeconductor/core/mixins.py#L104 . @tomchristie, if you think it's of a value, I can formulate a more proper pull request.

tomchristie commented 10 years ago

It's prob worth waiting for the pagination API before looking at a PR for an implementation, but yes that'd be great once we start pulling 3.1 together!

tomchristie commented 9 years ago

Note: lots of progress on this currently in the 3.1 branch.

tomchristie commented 9 years ago

Some possible remaining tweaks:

livenson commented 9 years ago

Is there a plan to implement also Headers-based pagination?

tomchristie commented 9 years ago

There is an example in the docs (in the incoming version-3.1 branch) that shows how to do it.

tomchristie commented 9 years ago

So yes, we'll be supporting it, but the built-in schemes won't use it directly - the Link header is probably a little awkward for some clients to parse, so happy for the defaults to all use in-body pagination info.

auvipy commented 9 years ago

so 3.1 is RC now?

tomchristie commented 9 years ago

Released.