Apr-15-2020, 03:40 PM
Hi I am new to Django
I have a Model with Buying and Selling Rate and have loaded data it.
Now i want to update the Model and a calculative column called Profit like:
Profit=models.FloatField(selling-buying)
It throws error.
What is the correct way to do it, how can i change value for the data which have been loaded earlier from python.
i know we have to do something in default=calculated_value
Kindly help.
Code: https://repl.it/repls/VigorousConsiderableVaporware
Error:
I have a Model with Buying and Selling Rate and have loaded data it.
Now i want to update the Model and a calculative column called Profit like:
Profit=models.FloatField(selling-buying)
It throws error.
What is the correct way to do it, how can i change value for the data which have been loaded earlier from python.
i know we have to do something in default=calculated_value
Kindly help.
Code: https://repl.it/repls/VigorousConsiderableVaporware
Error: