'Implements Python 2.7\'s datetime.timedelta.total_seconds()
for backwards compatibility with Python 2.5 and 2.6.'

@staticmethod
def total_seconds(value):

    try:
        return value.total_seconds()
    except AttributeError:
        return ((((value.days * 24) * 3600) + value.seconds) + (value.microseconds / 1000000.0))
