在Django管理网站中添加按钮

时间:2019-11-22 11:26:09

标签: django

enter image description here

如何在图片中放置按钮?它将链接到我的html中吗?

这是我的admin.py

@admin.register(gradingPeriodsSetting)
class gradingPeriodsSettingAdmin(admin.ModelAdmin):
    list_display = ('School_Year', 'Education_Levels', 'Courses', 'NumberOfGradingPeriods', 'Status')
    ordering = ('pk',)

models.py

class gradingPeriodsSetting(models.Model):
    School_Year = models.ForeignKey(SchoolYear, related_name='+', on_delete=models.CASCADE, null=True, blank=True)
    Education_Levels = models.ForeignKey(EducationLevel, related_name='+', on_delete=models.CASCADE, blank=True,
                                         null=True)
    Courses = models.ForeignKey(Course, related_name='+', on_delete=models.CASCADE, null=True, blank=True)
    NumberOfGradingPeriods = models.IntegerField(blank=True, null=True)

1 个答案:

答案 0 :(得分:0)

您可以为此扩展admin/change_list.html

您可以将django-reversion用作reference

这是django-dbtemplates的屏幕快照,带有django-reversion。enter image description here