【发布时间】:2021-04-27 17:45:53
【问题描述】:
我有一个列表:-
List salesr;
从 API 获取数据后,我将此结果添加到此列表中:-
salesr = redata["rows"];
print(salesr);
输出:-
[{customer_name: null, outgoing_id: 33, outgoing_code: 000000042, outgoing_totalAll: 23.0000, outgoing_date: 2021-01-22, customer_id: null}]
现在,当我打印此列表时,它运行良好.. 我的问题是如何将其他数据添加到此列表中?我想保留旧数据只是插入。
我尝试通过这种方式添加:
salesr.add(redata["rows"]);
但不工作
【问题讨论】:
-
Session()是什么? -
类发布 API .. 并返回
-
你能在问题中添加一个错误吗?
-
这一行的问题:salesr = redata["rows"]; ..当我调用函数时,它会删除列表中的所有数据并放入新数据..我想添加新数据和旧数据
-
我更新了我的问题,对不起,我的英语不好