我有一个包含条目列表的夹具 . 例如:
[
{
"fields": {
"currency": 1,
"price": "99.99",
"product_variant": 1
},
"model": "products.productprice",
"pk": 1
},
{
"fields": {
"currency": 2,
"price": "139.99",
"product_variant": 1
},
"model": "products.productprice",
"pk": 2
}
]
这只是每个条目的初始数据(价格可能会发生变化) . 我希望能够为该夹具添加另一个条目并使用 loaddata
加载它,但不更新数据库中已存在的条目 .
有没有办法做到这一点?类似于 --ignorenonexistent
但是对于现有条目 .