Home > other >  Ask for help about django goods batch update price
Ask for help about django goods batch update price

Time:09-26

Python django data update problem,

# goods have duplicate data, but different commodity code.
A id=1 # goods, name=iphone, code=001
Id=2 B # goods, name=iphone, code=002
# A commodities A ladder price associated pk=
# database A existing ladder price pk (goods Forkey=A)
# [{id=1, qty=1, price=1000, pk=1}, {id=2, qty=1, price=1000, pk=1}]
# query goods must pass the name + code to query to the designated as a result,
# according to the unique ID for the associated query sets QuerySet data have 2
# now needs to be associated with price update new ladder price list
# [{" qty ": 5, price=900}, {800}" qty ": 10, price=]
# could you tell me how to realize the batch update multiple data ladder price,

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Test error as a result, their test results, a new ladder price indices 0 or 1 are repeated data,


Objective the results


At present is the general problem, goods can be updated, but the corresponding foreign key steps the price can't update properly,
The association of multiple steps need to be solved price updates,
  • Related