Skip to content

Commit

Permalink
Merge branch 'master' of github.com:joowani/python-arango
Browse files Browse the repository at this point in the history
  • Loading branch information
joowani committed Jun 4, 2017
2 parents cfae343 + f7260a1 commit 6c06d82
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions arango/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,14 @@ def commit(self):
try:
if not self._requests:
return
raw_data = ''
raw_data_list = []
for content_id, request in enumerate(self._requests, start=1):
raw_data += '--XXXsubpartXXX\r\n'
raw_data += 'Content-Type: application/x-arango-batchpart\r\n'
raw_data += 'Content-Id: {}\r\n\r\n'.format(content_id)
raw_data += '{}\r\n'.format(request.stringify())
raw_data += '--XXXsubpartXXX--\r\n\r\n'
raw_data_list.append('--XXXsubpartXXX\r\n')
raw_data_list.append('Content-Type: application/x-arango-batchpart\r\n')
raw_data_list.append('Content-Id: {}\r\n\r\n'.format(content_id))
raw_data_list.append('{}\r\n'.format(request.stringify()))
raw_data_list.append('--XXXsubpartXXX--\r\n\r\n')
raw_data = ''.join(raw_data_list)

res = self.post(
endpoint='/_api/batch',
Expand Down

0 comments on commit 6c06d82

Please sign in to comment.