title: how can I return the sum (amount) sum(total_price) for each distinct currency that the user has made a transaction with
body: <p>I'm trying to return a query set in django that returns the total amount purchased SUM(amount), total price paid SUM(total_price) for each distinct currency that the user has made transactions with. Is this possiible? advice would be very much appreciated</p>
  
  <p>Transaction model below</p>
  
  <pre><code>
  class Transaction(models.Model):
      currency = models.CharField(max_length=20)
      amount = models.IntegerField()
      total_price = models.DecimalField(max_digits=8, decimal_places=2)
      date_purchased = models.DateTimeField()
      note = models.TextField(default="")
      owner = models.ForeignKey(User, on_delete=models.CASCADE)
  
  </code></pre>
  
  <p>Function below</p>
  
  <pre><code>@login_required
  def portfolio(request):
  
      sum_amount = Sum('amount')
      sum_total_price = Sum('total_price')
  
      context = {
          'transactions': Transaction.objects.filter(owner=request.user).annotate(
              current_amount=sum_amount,
              purchased_amount=sum_total_price
          )
      }
      return render(request, 'webapp/portfolio.html', context, {'title': 'Portfolio'})
  
  </code></pre>
  
  <p>HTML below</p>
  
  <pre><code>            {% for transaction in transactions %}
              &lt;tr&gt;
                  &lt;td&gt;{{transaction.current_amount}}&lt;/td&gt;
                  &lt;td&gt;{{transaction.purchased_amount}}&lt;/td&gt;
  
              &lt;/tr&gt;
              {% endfor %}
  
  </code></pre>
  
  <p>SaleForm Below </p>
  
  <pre><code>class SaleForm(forms.ModelForm):
  
      amount_sold = forms.IntegerField()
      total_price_sold = forms.DecimalField()
      date_sold = forms.DateField(
          widget=forms.TextInput(
              attrs={'type': 'date'}
          )
      )
      note = forms.CharField(widget=forms.TextInput(attrs={'placeholder': 'Keep a Note?'}))
  
      class Meta:
          model = Sale
          fields = ('date_sold', 'amount_sold', 'total_price_sold', 'note')
  
          labels = {
              'date_sold': _('Sale Date'),
          }
          help_texts = {
              'date_sold': 'Use Calendar to enter date',
          }
  
  </code></pre>