I would use the DB NOW() function for this. https://docs.djangoproject.com/en/1.9/ref/models/database-functions/#now from django.db.models.functions import Now .annotate(ratio=(F(‘due_date')-Now())/F('Interval'))
Peter of the Norse -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3520A304-1CF3-4569-8F73-033BD1D108E1%40Radio1190.org. For more options, visit https://groups.google.com/d/optout. |
- Query annotation with date difference Yoann Duriaud
- Re: Query annotation with date difference Constantine Covtushenko
- Re: Query annotation with date difference Yoann Duriaud
- Re: Query annotation with date differ... Constantine Covtushenko
- Re: Query annotation with date di... Constantine Covtushenko
- Re: Query annotation with date difference Yoann Duriaud
- Re: Query annotation with date difference Constantine Covtushenko
- Re: Query annotation with date differ... Peter of the Norse

