-
Notifications
You must be signed in to change notification settings - Fork 22
Add possiblity to send files in request body #168
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87d8fe7 to
00b4b2c
Compare
stefanmajoor
reviewed
Jul 2, 2021
stefanmajoor
suggested changes
Jul 5, 2021
stefanmajoor
left a comment
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.
The idea is good, and it is getting there. I do miss two things:
- Documentation. Both in the code (describe what new methods do, inline comments) as well as general documentation (this is how the method works). I had to try to figure out what exactly you were trying to implement from the implementation
- Only the good weather scenario is tested for the file upload. Can you also add tests for the edge cases? e.g. what happens if you do not set the "Data", or the "data" is incorrect. O
stefanmajoor
suggested changes
Aug 30, 2021
99ded81 to
790d075
Compare
When a model has annotations, it will crash. Also scope on pk. TODO: NEEDS TEST!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a possibility to send files deeply nested within data.
To do this you have to send a
multipart/form-datarequest with the data encoded as json in a field calleddata. The files within this data have to be replaced withnulland added to the multipart data as a file, the name of this file should befile:<path>where<path>is the keys that lead to the file joined with..Some other notable changes: So because of this I wanted to load json that is a str instead of only bytes, so I removed the
.decode()in jsonloads. This is backwards compatible for python >=3.6 since in that releasejson.loadswas changed to also accept binary data.