【发布时间】:2019-01-16 08:07:05
【问题描述】:
我正在使用清晰的表单来构建我的表单。现在我想在我的timesheet_jobs 字段中添加一个额外的<option> 标记,该字段是外键字段。请帮我在加载完所有选项后在我的<select> 中添加一个额外的<option> 字段。
forms.py
class ClockInForm(forms.ModelForm):
class Meta:
model = TimesheetEntry
fields = ['timesheet_jobs', 'timesheet_clock_in_date', 'timesheet_clock_in_time']
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
【问题讨论】:
标签: django django-models django-forms django-templates django-views