from datetime import timedelta
from django.db.models import DurationField, ExpressionWrapper, F
Entry.objects.annotate(
duration=ExpressionWrapper(
F('end') - F('start'), output_field=DurationField()
)
).filter(duration__gte=timedelta(minutes=time_in_minutes)
--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/xIP7hhp0WqQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
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/3bd1db8e-0b53-4b3b-b781-51e4cc8a687c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.