from odoo import models, fields, api
from odoo.exceptions import UserError, ValidationError,Warning


class event_teaching_day(models.Model):
    _name = 'event.teaching.day'
    _description = 'event teaching day'

    sequence = fields.Integer(string='order')
    day_teaching = fields.Date('Teaching Day')
    description=fields.Char('Description')
    event_id=fields.Many2one('event.event')
    
    teaching_session_ids=fields.One2many(
        'event.teaching.session',
        'teaching_day_id',
        string='Teaching session'
        
    )

class event_media_link(models.Model):
    _name = 'event.media.link'
    _description = 'event media link'

class event_teaching_session(models.Model):
    _name = 'event.teaching.session'
    _description = 'event teaching session'

    #teaching_session_id=fields.Many2one('event.teaching.day')
    #date_recording = fields.Date('Recording date')
    #start_time_recording = fields.Float('Recording start time')
    description_fr=fields.Char('Description FR')
    description_en=fields.Char('Description EN')
    duration=fields.Float('Duration')
    link_audio_fr = fields.Char('FR audio link')
    link_audio_en = fields.Char('EN audio link')
    link_video_fr = fields.Char('FR video link')
    link_video_en = fields.Char('EN video link')
    # format_recording =fields.Selection(string='Format',selection=[('audio','audio'),('video','video')],required=True, default='video')
    teaching_day_id=fields.Many2one('event.teaching.day')
    #language=fields.Selection(string='Language',selection=[('fr','fr'),('en','en')])

    