好的,所以我有一个看起来像这样的模型:
class OpHour( models.Model ):
days_of_the_week =((0,"Sunday"),
(1,"Monday"),
(2,"Tuesday"),
(3,"Wednesday"),
(4,"Thursday"),
(5,"Friday"),
(6,"Saturday"))
day = models.IntegerField(max_length=1, choices=days_of_the_week)
opening_time = models.TimeField()
closing_time = models.TimeField()
class Location( models.Model ):
name = models.CharField(max_length=200)
[...]
hours = models.ManyToManyField(OpHour)
我想在位置的更改页面中将 OpHour 显示和编辑为内联。如何使用 ModelAdmin 实现这一目标?