django-rest-framework/rest_framework
Kennedy Mwenja 7038571157 Enable cursor pagination of value querysets. (#4569)
To do `GROUP_BY` queries in django requires one to use `.values()`
eg this groups posts by user getting a count of posts per user.

```
Posts.objects.order_by('user').values('user').annotate(post_count=Count('post'))
```

This would produce a value queryset which serializes its result
objects as dictionaries while `CursorPagination` requires a queryset
with result objects that are model instances.

This commit enables cursor pagination for value querysets.

- had to mangle the tests a bit to test it out. They might need
  some refactoring.
- tried the same for `.values_list()` but it turned out to be
  trickier than I expected since you have to use tuple indexes.
2016-11-01 10:42:01 +00:00
..
authtoken Error codes (#4550) 2016-10-11 10:25:21 +01:00
locale Removous erronous duplicate Danish translation file (#4563) 2016-10-12 10:02:21 +01:00
static/rest_framework Browsable API navbar gets overlapped by highlighted pagination item fix (#4547) 2016-10-11 10:59:00 +01:00
templates/rest_framework Fixes #4532 (#4636) 2016-10-31 20:41:54 +00:00
templatetags Lazy hyperlink names (#4554) 2016-10-11 12:18:00 +01:00
utils Fix 3674 (#4571) 2016-10-13 12:43:43 +01:00
__init__.py Version 3.5.1 [ci skip] 2016-10-21 17:10:38 +01:00
authentication.py TokenAuthentication: Allow custom keyword in the header (#4097) 2016-05-04 10:53:34 +01:00
compat.py Fix guardian import (#4612) 2016-10-21 16:59:43 +01:00
decorators.py Version 3.5 (#4525) 2016-10-10 13:03:46 +01:00
exceptions.py Fix support of get_full_details() for Throttled exceptions (#4627) 2016-11-01 10:38:56 +00:00
fields.py Fix is_simple_callable with variable args, kwargs (#4622) 2016-10-25 20:47:24 +01:00
filters.py Fix FilterSet proxy (#4620) 2016-11-01 10:30:17 +00:00
generics.py Fix blank lines around docstrings 2016-03-17 11:06:47 +00:00
metadata.py Don't list M2M choices in OPTIONS requests. Refs #3751. (#4160) 2016-06-01 17:28:32 +01:00
mixins.py Fix prefetch_related updates. (#4553) 2016-10-11 11:07:40 +01:00
models.py Move models.resolve_model to serializers._resolve_model 2014-01-13 11:47:44 -05:00
negotiation.py Fixed various typos (#4366) 2016-08-08 09:32:22 +01:00
pagination.py Enable cursor pagination of value querysets. (#4569) 2016-11-01 10:42:01 +00:00
parsers.py Descriptive error from FileUploadParser when filename not included. (#4340) 2016-08-01 18:44:58 +01:00
permissions.py Access request.user.is_authenticated as property not method, under Django 1.10+ (#4358) 2016-08-05 11:04:01 +01:00
relations.py Lazy hyperlink names (#4554) 2016-10-11 12:18:00 +01:00
renderers.py Version 3.5 (#4525) 2016-10-10 13:03:46 +01:00
request.py Do not treat empty non-form input as HTML. (#4566) 2016-10-12 15:46:24 +01:00
response.py fixes response rendering with empty context (#4495) 2016-09-17 03:13:34 +01:00
reverse.py Version 3.5 (#4525) 2016-10-10 13:03:46 +01:00
routers.py Version 3.5 (#4525) 2016-10-10 13:03:46 +01:00
schemas.py Fix schema base paths (#4611) 2016-10-21 16:59:34 +01:00
serializers.py Make serializer fields import explicit (#4628) 2016-11-01 10:27:11 +00:00
settings.py Version 3.5 (#4525) 2016-10-10 13:03:46 +01:00
status.py Adding support for RFC 4918 status codes (#4291) 2016-07-26 11:09:12 +01:00
test.py Drop redundant requests adapter (#4639) 2016-11-01 10:24:53 +00:00
throttling.py Access request.user.is_authenticated as property not method, under Django 1.10+ (#4358) 2016-08-05 11:04:01 +01:00
urlpatterns.py Version 3.5 (#4525) 2016-10-10 13:03:46 +01:00
urls.py Add app_name to rest_framework.urls. 2015-12-08 02:25:00 +01:00
validators.py Error codes (#4550) 2016-10-11 10:25:21 +01:00
versioning.py Fix handling of ALLOWED_VERSIONS and no DEFAULT_VERSION (#4370) 2016-08-10 15:19:56 +01:00
views.py Don't lose exception info (#4638) 2016-11-01 10:22:30 +00:00
viewsets.py Remove code for old Django versions (#4513) 2016-09-23 23:03:02 +01:00