Question:
With the code below, I’m attempting to add the amount to my current balance but I am getting a ‘QuerySet’ object has no attribute ‘balance’Answer:
Right now you are trying to add a balance to your whole query string. If there is only one user investment, the. You could douser_investment = Investment.objects.all()[0]
Otherwise you need to use .get() and pull the user_investment that you are looking for, maybe
user_investment = Investment.objects.get(user=user)
If you have better answer, please add a comment about this, thank you!