Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: eLearning

Entity: slide.slide

Compute Method: _compute_youtube_id

Inputs Method Outputs
for slide in self:
            if slide.video_url and slide.video_source_type == 'youtube':
                match = re.match(self.YOUTUBE_VIDEO_ID_REGEX, slide.video_url)
                if match and len(match.groups()) == 2 and len(match.group(2)) == 11:
                    slide.youtube_id = match.group(2)
                else:
                    slide.youtube_id = False
            else:
                slide.youtube_id = False

Back to entity