[openstack-dev] [api] Retrieving the previous page of data

Steven Kaufer kaufer at us.ibm.com
Mon Mar 16 18:37:25 UTC 2015



I am trying to understand which projects support a previous link for
pagination and how that support is implemented.

I believe that supporting a next link is quite common and is implemented
as:

1. Caller includes a "marker" query string parameter which represents the
ID of the last item in the previous page of data
2. Corresponding marker object is used to set the filtering information on
the ORM query object in the common paginate_query function [1]

As a convenience, when the GET reply has been limited, many projects also
include a "next" href link that includes the next marker (allowing the
caller to simply invoke that link to get the next page of data).

I cannot find any utility functions to help generate the ORM query to
retrieve the previous page of data, does anyone know how projects implement
this? I have a few ideas on how to implement this by reversing the sort
directions but am first trying to understand what currently exists.

Does anyone know what support currently exists for a retrieving a previous
page of data?

[1]:
https://github.com/openstack/oslo.db/blob/master/oslo_db/sqlalchemy/utils.py#L174-L177

Steven Kaufer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150316/069ce9cc/attachment.html>


More information about the OpenStack-dev mailing list