Copy registers ManyToOne in Django

43 Views Asked by At

See my model

https://github.com/rg3915/vendas/blob/master/vendas_project/vendas/models.py#L117-L157

and see my gist

https://gist.github.com/rg3915/9c2c0d6b9db0a5e6e6e1

This gist copy the registers of SaleDetail to new SaleDetail. I have a field 'subtotal', and this is record.

When I copy the records everything works normal except the subtotal field.

I may have to use a command called post_save to copy this field.

How do I do this?

0

There are 0 best solutions below