django stream a dictionary multiple times w/o breaking JSON

前端 未结 1 1059
北恋
北恋 2021-01-16 20:23

I want to stream a response using Django. In order to do so, I have a view like this:

def flights(request, query): req_obj = Flights.RequestObject(query)

1条回答
  •  执笔经年
    2021-01-16 21:09

    Have you tried something like

    req_obj.update(req_obj.make_response())
    

    which will update your initial dict with the values newly yielded from your method?

    0 讨论(0)
提交回复
热议问题