Given the following models:
class Transaction(models.Model):
amount = models.IntegerField()
date = models.DateField()
terms = models.ForeignKey('Terms')
class Terms(models.Model):
name = models.CharField(max_length=100)
timezone = models.CharField(max_length=50)
I need to annotate T
Maybe something like this should work:
Terms.objects.annotate(
transactions_sum=models.Subquery(
Transaction.objects.filter(
terms=models.OuterRef("pk"),
)
# Now In order to filter by some date_range
# which vary by timezone, you would want to
Yes it is possible
Lent Asia technologies pvt Ltd,
Aakash chaudhary
On Thu, 3 Jan 2019, 11:32 Dustin Wyatt Given the following models:
>
>
> class Transaction(models.Model):
> amount = models.IntegerField()
> date = models.DateField()
> terms = models.ForeignKey('Terms')
>
>
> class Terms
3 matches
Mail list logo