Beispiel #1
0
 def expires_in(self):
     """Minutes"""
     if self.leased_until is None:
         return "never"
     seconds = (self.leased_until - timezone.now()).total_seconds()
     if seconds <= 0.0:
         return "Expired!"
     else:
         return nice_seconds(seconds)
Beispiel #2
0
 def expires_in(self):
     """Minutes"""
     if self.leased_until is None:
         return "never"
     seconds = (self.leased_until - timezone.now()).total_seconds()
     if seconds <= 0.0:
         return "Expired!"
     else:
         return nice_seconds(seconds)
def nice_timedelta(timedelta):
    try:
        return mark_safe(nice_seconds(timedelta.total_seconds()))
    except AttributeError:
        return mark_safe("None")
Beispiel #4
0
def nice_timedelta(timedelta):
    try:
        return mark_safe(nice_seconds(timedelta.total_seconds()))
    except AttributeError:
        return mark_safe('None')