Client get data combined from two tables. Here is the code from the file views.py
:
...
dbdataA = TableA.objects.filter(user=user)
dbdataB = TableB.objects.filter(user=user).order_by("field1")
result_list = list(chain(orders, alldata))
msg = serializers.serialize("json", result_list, fields=("field1","field2","field3","field4"), use_natural_keys=True)
return HttpResponse(msg)
and I need to add a var with current time to response. How to do this?
UPD: Any data passed to chain(orders, alldata, ...) gives error " 'str' object have no attribute '_meta' " in string " msg =serializers.serialize...". Maybe it's because chain() can't take any data except iterable, but (time.asctime(time.localtime()) is not iterable?