Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fixed rendering of non paginated responses #114

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

Merged
jerel merged 1 commit into django-json-api:develop from abdulhaq-e:non_paginated_fix
Oct 8, 2015

Conversation

Copy link
Contributor

@abdulhaq-e abdulhaq-e commented Oct 2, 2015

No description provided.

def setUp(self):
super(GenericViewSet, self).setUp()

setattr(settings, 'JSON_API_FORMAT_KEYS', 'dasherize')
Copy link
Contributor Author

@abdulhaq-e abdulhaq-e Oct 2, 2015

Choose a reason for hiding this comment

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

The attributes used in the JSON were dasherized so this is needed. Previously, the tests passed by coincidence due to another test changing the format to 'dasherize'.

@@ -109,6 +109,9 @@ class PageNumberPagination(BasePagination):
A json-api compatible pagination format
"""

page_size_query_param = 'page_size'
max_page_size = 100

Copy link
Member

@jsenecal jsenecal Oct 5, 2015

Choose a reason for hiding this comment

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

Why is this there ?

# Default is 'None'. Set to eg 'page_size' to enable usage.
page_size_query_param = None
# Set to an integer to limit the maximum page size the client may request.
# Only relevant if 'page_size_query_param' has also been set.
max_page_size = None

From BasePagination class....

Copy link
Contributor Author

@abdulhaq-e abdulhaq-e Oct 5, 2015

Choose a reason for hiding this comment

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

I moved those from the settings. Pagination configuration from Drf >= 3.1 should be set in the pagination class. Putting them in the view or settings as per Drf < 3.1 now produces a 'deprecation warning' and I think it will produce an error from Drf 3.3.

Copy link
Member

@jsenecal jsenecal Oct 5, 2015

Choose a reason for hiding this comment

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

HA! good catch ! Thanks for that!

Copy link
Member

jsenecal commented Oct 5, 2015

I'm 👍 on this one @jerel, all yours :)

@jerel jerel merged commit a9d85cb into django-json-api:develop Oct 8, 2015
@abdulhaq-e abdulhaq-e deleted the non_paginated_fix branch February 3, 2017 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /