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

Version 3.1 #1169

Closed
6 tasks done
tomchristie opened this issue Oct 10, 2013 · 19 comments
Closed
6 tasks done

Version 3.1 #1169

tomchristie opened this issue Oct 10, 2013 · 19 comments
Assignees
Labels
Milestone

Comments

@tomchristie
Copy link
Member

Link to draft release announcement

Headline features include:

  • Versioning API.
  • Pagination API, cursor based pagination, controls in browsable API.
  • Internationalization.
  • Support for Django 1.8 fields.
  • ModelSerializer API.
  • YAML, XML, JSONP, OAuth move into third party packages.

Required

  • Mark the old global pagination settings as pending deprecation.
  • Finish documenting pagination.
  • Figure out if any of the pagination attribute names need to change, and which of the global settings should stay.
  • Review if Remove '.model' shortcut from viewset docs #2550 is covered by this work.
  • Demonstrate how to use internationalization as first section on that page, and in the announcement.
  • Upgrade deprecation warnings.

Optional

  • Strip '=' on cursor based pagination.
  • Ensure we handle None, True, False values on cursor based pagination.
  • Consider further performance improvements based on benchmarking. (Esp improve the common case for attribute lookup on fields) - Dropped. To be considered for 3.2.
  • Add example for serializer_field_mappings (and consider allowing partial overrides.)
  • Decide if DurationField should make the cut, given that we're headlining the 1.8 fields - if we've got this all mostly wrapped up then we could move it in. - Dropped
@jacobg
Copy link
Contributor

jacobg commented Oct 29, 2013

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

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

thedrow commented Nov 3, 2013

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

If you are going to drop the numbered paging implementation

There's no plan for that to happen.

@thedrow
Copy link
Contributor

thedrow commented Nov 3, 2013

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

@tomchristie
Copy link
Member Author

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//issues/1169#issuecomment-27645242
.

@ghost
Copy link

ghost commented Jan 28, 2014

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

iorlas commented Jul 21, 2014

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

@tomchristie
Copy link
Member Author

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

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

@livenson
Copy link

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

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

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

@tomchristie
Copy link
Member Author

Some possible remaining tweaks:

  • Determine how/if True, False and None positions work with CursorPagination - do the string encodings work with Django queryset filters?
  • Consider a max offset cap for CursorPagination?
  • Tidy up the get_ordering API (eg remove queryset from it)
  • Determine any changes in settings names.
  • first/last page methods for cursor pagination.
  • Visually distinct cursors.

@livenson
Copy link

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

@tomchristie
Copy link
Member Author

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

@tomchristie
Copy link
Member Author

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.

@tomchristie tomchristie changed the title Improve the pagination API. Version 3.1. Feb 13, 2015
@tomchristie tomchristie changed the title Version 3.1. Version 3.1 Feb 13, 2015
@auvipy
Copy link
Member

auvipy commented Mar 5, 2015

so 3.1 is RC now?

@tomchristie
Copy link
Member Author

Released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants