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 19360 annotate the sum of related TimeField Luc Saffre chrismedrela "I get a ""TypeError: expected string or buffer"" when I try to annotate the sum of a timefield in a related model. {{{ class Ticket(models.Model): name = models.CharField(max_length=200) class Session(models.Model): ticket = models.ForeignKey(Ticket,related_name=""sessions"") time = models.TimeField() qs = Ticket.objects.annotate(timesum=models.Sum('sessions__time')) print [unicode(t.timesum) for t in qs] }}} Please see the attached files for a complete test case." Bug closed Database layer (models, ORM) dev Normal fixed chrismedrela Ready for checkin 1 0 0 0 0 0