﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24485	Support for annotate(end=F('start') + F('duration'), output_field=DateTimeField)	Michael Angeletti	Josh Smeaton	"I've modeled a {{{Ticket}}} as such:

{{{
class Ticket(models.Model):
    # ... other fields omitted
    active_at = models.DateTimeField()
    duration = models.DurationField()
}}}

Using {{{duration}}} this way is more valuable than simply defining an {{{expires_at}}} {{{DateTimeField}}}, because it has the same amount of information and also allows me to do things like {{{Ticket.objects.filter(duration__gt=timedelta(days=1))}}}. However, I ran into a problem when I tried to run the following:

{{{
Ticket.objects.annotate(
    expires_at=models.Sum(
        models.F('active_at') + models.F('duration'),
        output_field=models.DateTimeField()
    )
)
}}}

The exception occurs during datetime parsing when a {{{float}}} is encountered during an attempted regexp search. Does this imply that all {{{Sum}}} results will be of the type {{{float}}}? If so, does that disqualify supporting the above example as a possible feature?"	New feature	closed	Database layer (models, ORM)	1.8beta2	Release blocker	fixed	durationfield, aggregation, annotation		Ready for checkin	1	0	0	0	0	0
