From: gfawcett Date: Thu, 29 Jul 2010 03:06:19 +0000 (+0000) Subject: fix timespan midpoint arithmetic X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2fc8e684ba1ad97878b640cd339a857f57a24298;p=Syrup.git fix timespan midpoint arithmetic git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@940 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/conifer/syrup/models.py b/conifer/syrup/models.py index 493d08b..21a4e4c 100644 --- a/conifer/syrup/models.py +++ b/conifer/syrup/models.py @@ -142,7 +142,7 @@ class Term(BaseModel): return '%s: %s' % (self.code, self.name) def midpoint(self): - return self.start + timedelta(days=(self.start-self.finish).days/2) + return self.start + (self.finish-self.start) / 2 class Department(BaseModel): name = m.CharField(max_length=256)