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

Paginated delete (fixes #987) #997

Merged
merged 2 commits into from
Dec 20, 2016
Merged

Paginated delete (fixes #987) #997

merged 2 commits into from
Dec 20, 2016

Conversation

leplatrem
Copy link
Contributor

@leplatrem leplatrem commented Dec 20, 2016

Fixes #987

  • Add limit/sorting to querystring
  • Add next-page header to plural delete responses
  • Plug model resource models
  • Add necessary parameters to storage backend
  • Check out documentation

@@ -110,6 +111,12 @@ def delete_records(self, filters=None, parent_id=None):
comparison (see `kinto.core.utils.COMPARISON`). All filters
are combined using *AND*.
:type filters: list of :class:`kinto.core.storage.Filter`
:param sorting: XXX
Copy link
Member

Choose a reason for hiding this comment

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

     :param filters: Optionally filter the records by their attribute.
         Each filter in this list is a tuple of a field, a value and a
         comparison (see `kinto.core.utils.COMPARISON`). All filters
         are combined using *AND*.
     :type filters: list of :class:`kinto.core.storage.Filter`

     :param sorting: Optionnally sort the records by attribute.
         Each sort instruction in this list refers to a field and a
         direction (negative means descending). All sort instructions are
         cumulative.
     :type sorting: list of :class:`kinto.core.storage.Sort`

     :param pagination_rules: Optionnally paginate the list of records.
         This list of rules aims to reduce the set of records to the current
         page. A rule is a list of filters (see `filters` parameter),
         and all rules are combined using *OR*.
     :type pagination_rules: list of list of
         :class:`kinto.core.storage.Filter`

     :param int limit: Optionnally limit the number of records to be
        retrieved.

@leplatrem leplatrem merged commit 9db090e into master Dec 20, 2016
@leplatrem leplatrem deleted the 987-paginated-delete branch December 20, 2016 15:07
gabisurita added a commit to gabisurita/kinto that referenced this pull request Dec 20, 2016
@@ -111,6 +112,22 @@ def delete_records(self, filters=None, parent_id=None):
are combined using *AND*.
:type filters: list of :class:`kinto.core.storage.Filter`

:param sorting: Optionnally sort the records by attribute.
Copy link
Contributor

Choose a reason for hiding this comment

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

Optionally 🐑

Copy link
Member

@gabisurita gabisurita left a comment

Choose a reason for hiding this comment

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

I've just noticed that there is no Total-Records header. I think we should also add it on DELETE for consistency.

@leplatrem
Copy link
Contributor Author

@gabisurita so it should return the total records that will deleted accross all pages right?

@gabisurita
Copy link
Member

@leplatrem Yes, I think so. It should return the number of buckets that would be deleted without pagination.

@leplatrem
Copy link
Contributor Author

could you open an issue please :) ?
I think it's trivial because we do a get_all() just before performing the deletion...

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.

4 participants