Just show the seasons which are related to the course Django Admin Panel

hi guys i have a 3 model:

class Course(models.Model):
    title = models.CharField(max_length=30)
    description = models.TextField()
    author = models.ForeignKey(User, on_delete=models.CASCADE, related_name="courses")


class Season(models.Model):
    course = models.ForeignKey(Course, on_delete=models.CASCADE, related_name="course_season")
    name = models.CharField(max_length=40)


class CourseVideo(models.Model):
    title = models.CharField(max_length=30)
    course = models.ForeignKey(Course, on_delete=models.CASCADE, related_name="course_videos")
    season = models.ForeignKey(Season, on_delete=models.CASCADE, related_name="season", null=True, blank=True)
    video = models.FileField(upload_to="vid/course_video")

and this is my admin file :

class DetailAdmin(admin.TabularInline):
    model = models.CourseVideo


class SeasonAdmin(admin.TabularInline):
    model = models.Season


@admin.register(models.Course)
class CourseAdmin(admin.ModelAdmin):
    inlines = (SeasonAdmin, DetailAdmin)
    list_display = ("title", "price")

now my problem is in the django`s admin panel when i have created forexample 2 seasons for each course and i want to create some videos when i wanna choose a season for a video , it shows all the seasons which is created but i just want it to show the seasons who are related to the course . what should i do ?

From the official docs for reference Model field reference | Django documentation | Django

You can update your model like

class CourseVideo(models.Model):
    title = models.CharField(max_length=30)
    course = models.ForeignKey(Course, on_delete=models.CASCADE, related_name="course_videos")
    season = models.ForeignKey(
        Season,
        on_delete=models.CASCADE,
        related_name="season",
        null=True,
        blank=True,
        limit_choices_to={'course': models.F('course')}
    )
    video = models.FileField(upload_to="vid/course_video")