Annotate a sum of two fields multiplied

后端 未结 6 861
闹比i
闹比i 2021-01-30 13:28

I have three models, simplified for the example:

class Customer(models.Model):
    email = models.CharField(max_length=128)

class Order(models.Model):
    custo         


        
6条回答
  •  醉酒成梦
    2021-01-30 13:52

    You'll probably need to roll out your own custom aggregator. You can find a simple walk through of a GROUP_CONCAT example that should get you started here: http://harkablog.com/inside-the-django-orm-aggregates.html

提交回复
热议问题