def duration(self): return minsec(ytapi(self.video_id))
def duration(self): obj = Module.objects.get(id=self.id) videos = [ytapi(i.video_id) for i in obj.lesson_set.all()] return minsec(list(itertools.accumulate(videos))[-1])