-
Notifications
You must be signed in to change notification settings - Fork 0
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
Migrate to django-ninja #745
Conversation
874b108
to
64242e9
Compare
9a7a402
to
a4e6929
Compare
This is essentially a direct port of DRF's cursor-based pagination impl to django-ninja.
a4e6929
to
39974f7
Compare
1407952
to
a4a33ad
Compare
@danlamanna the tests are now passing; this is probably a good time to do a mid-stream code review to make sure the changes I made are reasonable. |
f"/api/v2/collections/{collection.pk}/populate-from-search/", {"query": "sex:male"} | ||
f"/api/v2/collections/{collection.pk}/populate-from-search/", | ||
{"query": "sex:male"}, | ||
content_type="application/json", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we ok with having to add this to every test request with a JSON body, or should we make our own subclass of Django's test Client
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A: We should use ninja.testing.TestClient
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I think using the django.test.Client
is preferable until this issue is resolved.
This should go away when vitalik/django-ninja#825 is resolved.
We were already checking for other permissions on them before taking action, but we should also make sure the user can see them first.
4c556b3
to
cd231d2
Compare
cd231d2
to
61869b7
Compare
f80bf94
to
81c996c
Compare
e6faa6a
to
9ca745e
Compare
8f9e269
to
f8d7eb4
Compare
7ca69bc
to
76326a4
Compare
76326a4
to
abac9e5
Compare
6f679c2
to
c188eed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome! Reviewing this PR reminded me of how big our API surface is, so thanks for slogging through it all. Zip download works well on my end.
Co-authored-by: Dan LaManna <[email protected]>
Co-authored-by: Dan LaManna <[email protected]>
Because we want to treat the cursor values as opaque, it seemed simplest to do this all in one test case.
I believe all feedback has been addressed, PTAL. |
related https://github.com/ImageMarkup/tracker/issues/143