title: Adding Sum of Object Attributes to Django Rest Framework Response
body: <p>I'm Trying to add the sum of multiple objects to a DRF response. For example, right now the response works with just listing the objects:</p>
  
  <pre><code>[
      {
          "id": "47d0deaa5c8c",
          "amount": "25.00"
      },
      {
          "id": "29787731",
          "amount": "25.00"
      }
  ]
  </code></pre>
  
  <p>But what I want is to be able to sum the amount attribute of those objects together and then include that in the response, so that it would look like this:</p>
  
  <pre><code>{  
     "sum":"50.00",
     "objects":[  
        {  
           "id":"47d0deaa5c8c",
           "amount":"25.00"
        },
        {  
           "id":"29787731",
           "amount":"25.00"
        }
     ]
  }
  </code></pre>
  
  <p>Here's my current APIView:</p>
  
  <pre><code>class TransactionsList(GenericAPIView):
  """
  Retrieve list of transactions
  """
  
  authentication_classes = (TokenAuthentication,)
  permission_classes = (IsAuthenticated,)
  
  def get(self, request):
      """List Transactions"""
      transaction = Transaction.objects.all()
      serializer = TransactionSerializer(transaction, many=True)
      return Response(serializer.data)
  </code></pre>
  
  <p>And Serializer:</p>
  
  <pre><code>class TransactionSerializer(serializers.ModelSerializer):
  
  class Meta:
      model = Transaction
      fields = ('id', 'amount')
  </code></pre>
  
  <p>How could I efficiently go about adding the sum field into the response?</p>