M
Size: a a a
M
AO
AO
AO
S
AO
AO
AO
DN
DT
DN
DT
А
DN
DN
def update(self, instance, validate_data):
with transaction.atomic():
new_inventory_data = validate_data.pop('new_inventory')
new_inventory = Inventory.objects.create(**new_inventory_data)
instance.new_inventory = new_inventory
instance.current_inventory = validate_data.pop('current_inventory')
instance.save()
return instance
DN
DT
DT
def update(self, instance, validate_data):
with transaction.atomic():
new_inventory_data = validate_data.pop('new_inventory')
new_inventory = Inventory.objects.create(**new_inventory_data)
instance.new_inventory = new_inventory
instance.current_inventory = validate_data.pop('current_inventory')
instance.save()
return instance
D
DN