Best way to check fields before update in nested list

Hi,

I’m looking for an example on how to manage checks before update.
I’ve seen the code:

actions = iter(args)
for..., values in zip(actions, actions)

But what’s the best practice to parse ‘values’ to identify for instance a field quantity in a list (could have create + write in the same update)?
Cause you could have several format: {'quantity': [[create, [[write or [[add and [create etc., so for the moment I test the different format with poor code like that:

if values['quantity'][0][0] == 'add'

Tks,
Laurent

Why not do the check on the children Model?

Also why doing check before the update? It will be much simpler after.

I have a position model with a list of pricing (children model).
When user modify pricings quantities I need to send a message if sum(pricings.quantity)>position.quantity.
If I do it in the children model I cannot see all the modification done for existing pricing of the list because a user could change quantities in 2 item of a list, create a new one and save after.

Checking after means doing a rollback if limit quantity is achieved ?

Failing validation always rollback the transaction.

Oh ok so it makes the thing easer tks Cedric