我正在尝试创建简单的事件应用程序,所以我决定创建事件和一些内联事件发生:
class EventOccurenceInline(admin.TabularInline):
model = models.EventOccurance
form = forms.EventOccuranceForm
pass
class EventAdmin(TranslatableAdmin):
list_display = [ "internal_name"]
inlines = [
EventOccurenceInline,
]
pass
这是forms.py:
class EventOccurenceForm(TranslatableModelForm):
start_date = forms.DateTimeField()
end_date = forms.DateTimeField()
class Meta:
model = models.EventOccurence
但是,当我打开后端时,我只看到简单的输入而不是 DateTime 选择器,甚至这些字段的标签也没有说明:
有谁知道如何在内联中使用这些小部件?我究竟做错了什么?
在此先感谢,迈克尔