in addition to what @Thomas said you need to first perform an aggregated
sum on the payments model hence the need for ...
loan.payments_set.aggregrate(models.Sum('amount'))
the above returns the sum of all payment related to your loan instance from
which you can now subtract from loan.amount_to_
there're two possible reasons for this:
* you don't have those filled in your forms.py module or
* your forms filled is not of the same case (upper or lower) with your
request.Post[ ] query.
but next time, try and add screenshot while asking question, its gives
whoever that is responding more in
2 matches
Mail list logo