You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I forked your repo to make it work for my use-case based on Django 2.0. The most significant change I made is to use dictionaries instead of json strings:
Out of curiosity: why are strings used instead of dictionaries in your repo? I must say that I was very opportunistic in changing the code to make it work for me, and did not spend a lot of time on thinking how things ought to work from a theoretical point of view. I came up with this solution because it seemed the most practical one.
If you are interested (and I have enough time) I could make a pull request with my changes.
The text was updated successfully, but these errors were encountered:
@mnieber - Thanks for raising this. The idea of keeping it to strings was that, the framework itself needs to be generic and it should be able to handle multiple representation formats, which is not unusual with REST APIs. This way, we have 2 advantages:
We can support non JSON (xml, yml etc) http calls.
Avoids serializing and deserializing the json from string and back.
I think that it would be really useful to have a batch-request feature in Django 2, so I took another look at your solution. I agree that a string is actually a reasonable format to use as the body in each request. However, I'm running into too many strange decoding-related errors when executing the tests. Probably your approach is fine but there are several Django 2 implementation details that need to be taken into account. Maybe I will try again later.
@mnieber You may be correct about issues with Django 2.0. I haven't tried with Django 2.0 before. If you could share some sample failing tests, it would help to know what the issues could be, and we could quickly supply a fix.
Hi, I forked your repo to make it work for my use-case based on Django 2.0. The most significant change I made is to use dictionaries instead of json strings:
a dictionary is used as the body of each sub-request in the batch (https://github.com/mnieber/django-batch-requests/commit/71a05d2afeba7f074e32fd8d69873d37b3556acf)
the response to each sub-request is stored as a dictionary (https://github.com/mnieber/django-batch-requests/commit/8dbe50d7203563661f269a040c1685db88a18cd3)
Out of curiosity: why are strings used instead of dictionaries in your repo? I must say that I was very opportunistic in changing the code to make it work for me, and did not spend a lot of time on thinking how things ought to work from a theoretical point of view. I came up with this solution because it seemed the most practical one.
If you are interested (and I have enough time) I could make a pull request with my changes.
The text was updated successfully, but these errors were encountered: