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

Add a default ordering on Django ViewSets #704

Open
ieaves opened this issue Oct 9, 2023 · 4 comments
Open

Add a default ordering on Django ViewSets #704

ieaves opened this issue Oct 9, 2023 · 4 comments
Assignees
Labels
grai-server Created by Linear-GitHub Sync hacktoberfest linear

Comments

@ieaves
Copy link
Contributor

ieaves commented Oct 9, 2023

The current Django ViewSets do not include ordering or ordering_fields settings which can affect paginated endpoints.

These should be set on

When complete, tests will no longer generate UnorderedObjectListWarning's e.g.

workspaces/tests/test_views.py::TestMemberships::test_get_memberships
workspaces/tests/test_views.py::TestMemberships::test_get_memberships_filter_by_is_active
  /Users/ian/Library/Caches/pypoetry/virtualenvs/the-guide-y4fToIIm-py3.11/lib/python3.11/site-packages/rest_framework/pagination.py:200: UnorderedObjectListWarning: Pagination may yield inconsistent results with an unordered object_list: <class 'workspaces.models.Membership'> QuerySet.
    paginator = self.django_paginator_class(queryset, page_size)
@ieaves ieaves added linear hacktoberfest grai-server Created by Linear-GitHub Sync labels Oct 9, 2023
@Tejoooo
Copy link

Tejoooo commented Oct 13, 2023

@ieaves can u assign me this issue

@ieaves ieaves assigned ieaves and Tejoooo and unassigned ieaves Oct 13, 2023
@ieaves
Copy link
Contributor Author

ieaves commented Oct 13, 2023

Absolutely! Thans for the help @Tejoooo !

@ieaves
Copy link
Contributor Author

ieaves commented Oct 19, 2023

Hey @Tejoooo just a quick checkin. Are you still working on this or should I unassign it?

@Tejoooo
Copy link

Tejoooo commented Oct 19, 2023

Yes I'm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grai-server Created by Linear-GitHub Sync hacktoberfest linear
Projects
Status: No status
Development

No branches or pull requests

2 participants