already_transferred = Transfer.objects.all().filter(transferred_by=request.user, account_id=id).aggregate(total=Coalesce(Sum('amount'), 0))
и сервер выдает эту ошибку
function sum(text) does not exist
LINE 1: SELECT COALESCE(SUM("API_insidetransfer"."amount"), 0) AS "a...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
вот моя модель
class Transfer(models.Model):
transferred_by = models.CharField(max_length=120)
account_id = models.CharField(max_length=120)
amount = models.CharField(max_length=120, default=0)
created_on = models.DateTimeField(auto_now=True)
как я могу это исправить?