Saturday, July 30, 2016

Query annotation with date difference

I would like to annotate a query with the following expression: ([Due Date] - [Now])/[Interval]. [Due Date] and [Interval] are fields from the database, while [Now] should be "equal" to

So this would look like:

but this does not work. Does someone know how the expression should be written (if it is indeed feasible with Django ORM)?

Thanks for your help!


You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment