[Answered ]-TypeError in Django: "float () argument must be a string or a number, not 'tuple.'"

1👍

The problem appears to be the trailing comma turning price into a tuple.

        form.instance.bought_price = price,

should be

        form.instance.bought_price = price

The only difference is the comma at the end. The other assignment lines before and after probably need their commas removed as well.

Check out this question for more.

👤kmd

Leave a comment