ModelChoiceField in ModelForm passes None

I’m very new to Django.
I’m making form to add timetable to specific branch.
So I have ‘Branch’ model and ‘Timetable’ model.
‘Branch’ model is in ‘branches’ app and ‘Timetable’ model is in ‘schedules’ app.
What I’m expecting is when users fill in the form to add timetable, they can choose which branch to add it from select box.

Error message is this.
Error message from Django debug mode

Here is my codes

from django.core.validators import RegexValidator
from django.db import models
from django.urls import reverse

# Create your models here.
phone_validator = RegexValidator(
    message="It's not correct phone number format.",

class Branch(models.Model):
    srl = models.BigAutoField(primary_key=True, verbose_name="Serial")
    name = models.TextField(verbose_name="Branch name")
    postcode = models.CharField(max_length=5, verbose_name="Postcode")
    address1 = models.TextField(verbose_name="Road address")
    address2 = models.TextField(verbose_name="Detail address", blank=True)
    phone1 = models.CharField(max_length=13, validators=[phone_validator], verbose_name="Phone 1")
    phone2 = models.CharField(max_length=13, validators=[phone_validator], verbose_name="Phone 2", blank=True)
    is_opened = models.BooleanField(default=True, verbose_name="Is opened?")

    class Meta:
        verbose_name = "Branch"
        verbose_name_plural = "Branches"
        ordering = ["srl"]

    def __str__(self):

    def get_absolute_url(self):
        return reverse("branches:detail", kwargs={"srl":})


import datetime

from django.conf import settings
from django.db import models

class Timetable(models.Model):
    srl = models.BigAutoField(primary_key=True, verbose_name="Serial")
    branch_srl = models.ForeignKey(
        verbose_name="Branch Serial",
    period = models.DecimalField(
    period_length = models.DurationField(
        verbose_name="Period Length",
    is_holiday = models.BooleanField(default=False, verbose_name="Is holiday?")
    start_time = models.TimeField(default=datetime.time(10, 00), verbose_name="Start time")
    end_time = models.TimeField(default=datetime.time(23, 00), verbose_name="End time")


from django import forms
from django.forms import ModelChoiceField, ModelForm

from branches.models import Branch
from schedules.models import Schedule, Timetable

class TimetableForm(ModelForm):
    branch_choices = ModelChoiceField(
        widget=forms.Select(attrs={"class": "form-select"}),

    class Meta:
        model = Timetable
        fields = (
        labels = {
            "period": "Period",
            "period_length": "Period Length",
            "is_holiday": "Is Holiday?",
            "start_time": "Start Time",
            "end_time": "End Time",
        widgets = {
            "period": forms.NumberInput(attrs={"class": "form-control"}),
            "period_length": forms.TimeInput(
                    "class": "form-control",
            "is_holiday": forms.RadioSelect(
                choices=[(True, "Yes"), (False, "No")],
                    "class": "form-check-input",
            "start_time": forms.TimeInput(
                    "type": "time",
                    "class": "form-control",
            "end_time": forms.TimeInput(
                    "type": "time",
                    "class": "form-control",


from django.apps import apps
from django.urls import reverse_lazy
from django.views.generic.base import TemplateView
from django.views.generic.detail import DetailView
from django.views.generic.edit import CreateView
from django.views.generic.list import ListView

from schedules.forms import TimetableForm
from schedules.models import Schedule, Timetable

# Create your views here.
class AddTimetableView(CreateView):
    model = Timetable
    form_class = TimetableForm
    # This should be changed. This is temporary
    success_url = reverse_lazy("schedules:index")

    def get_context_data(self, **kwargs):
        context = super().get_context_data(**kwargs)
        context["page_title"] = "Add timetable"

        return context

For your information, I’m using Bootstrap 5 and related CDN link is in main/base.html

{% extends "main/base.html" %}
{% load static %}
{% block content %}
    <form action="" method="POST" id="timetable-form" class="container d-grid gap-3 justify-content-evenly align-items-center">
        {% csrf_token %}
        {{ form.non_field_errors }}
        <div class="row">
            <label class="col-3 col-form-label text-nowrap" for="{{ form.branch_choices.id_for_label }}">{{ form.branch_choices.label }}</label>
            <div class="col">{{ form.branch_choices }}</div>
            {{ form.branch_choices.errors }}

        <div class="row">
            <label class="col-3 col-form-label text-nowrap" for="{{ form.period.id_for_label }}">{{ form.period.label }}</label>
            <div class="col">{{ form.period }}</div>
            {{ form.period.errors }}
        <div class="row">
            <label class="col-3 col-form-label text-nowrap" for="{{ form.period_length.id_for_label }}">{{ form.period_length.label }}</label>
            <div class="col">{{ form.period_length }}</div>
            {{ form.period_length.errors }}
        <div class="row">
            <label class="col-3 col-form-label text-nowrap" for="{{ form.is_holiday.id_for_label }}">{{ form.is_holiday.label }}</label>
            <div class="col">
                {% for choice in form.is_holiday %}
                    <div class="form-check">
                        {{ choice.tag }}
                        <label class="form-check-label" for="{{ choice.id_for_label }}">{{ choice.choice_label }}</label>
                {% endfor %}
            {{ form.is_holiday.errors }}
        <div class="row">
            <label class="col-3 col-form-label text-nowrap" for="{{ form.start_time.id_for_label }}">{{ form.start_time.label }}</label>
            <div class="col">{{ form.start_time }}</div>
            {{ form.start_time.errors }}
        <div class="row">
            <label class="col-3 col-form-label text-nowrap" for="{{ form.end_time.id_for_label }}">{{ form.end_time.label }}</label>
            <div class="col">{{ form.end_time }}</div>
            {{ form.end_time.errors }}
        <div class="row">
            <div class="col d-flex justify-content-end">
                <button class="btn btn-primary" type="submit">저장</button>
{% endblock %}

The error is saying that the field branch_srl is null when it’s being inserted so it violates the NOT NULL CONSTRAINT. If you check your form, the form doesn’t use that field, but instead it uses branch_choices. You need to map the selected value for that field to branch_srl somewhere. It can be in, AddTimetableView.form_valid() or you could rename the field branch_choices to branch_srl so it saves through to the database.

Wow, thanks.
I thought if I use same name with the model might cause error.