fix timespan midpoint arithmetic
authorgfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Thu, 29 Jul 2010 03:06:19 +0000 (03:06 +0000)
committergfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Thu, 29 Jul 2010 03:06:19 +0000 (03:06 +0000)
git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@940 6d9bc8c9-1ec2-4278-b937-99fde70a366f

conifer/syrup/models.py

index 493d08b..21a4e4c 100644 (file)
@@ -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)