def display_user_time(self, user): """ Display the amount of time on this task for selected user. """ seconds = 0 for tslice in self.timeslices.filter(user=user): if tslice.duration: seconds += tslice.duration return format_seconds(seconds)
def slice_time_display(value): """ Convert a timeslice's duration in seconds to something more presentable like 1:30 for 1 hour and 30 minutes instead of 5400 seconds """ return format_seconds(value)
def display_time(self): """ Display the amount of time on this task. """ seconds = 0 for tslice in self.timeslices.all(): if tslice.duration: seconds += tslice.duration return format_seconds(seconds)