Try this:
Process.objects.filter(exchange__input__unit__unit="kilogram")\
.annotate(sum_amount=Sum("exchange__amount"))\
.filter(sum_amount__gt=1)
On Fri, Jan 16, 2009 at 12:38 PM, Christopher Mutel
wrote:
>
> Following the general rule that no
Following the general rule that no good deed goes unpunished, I have a
question about complex aggregation / annotation or annotation across
foreign keys.
I have the following simplified model:
class Unit(models.Model):
unit = models.TextField()
class Process(models.Model):
process = mod
2 matches
Mail list logo