如何在Django管理面板中编辑字段

时间:2022-09-12 08:56:52

I do not see edit icon in django admin panel in the detail page of my model. It looks like this:

我在模型的详细信息页面中没有看到django管理面板中的编辑图标。它看起来像这样:

如何在Django管理面板中编辑字段

Thus normally it should have add icon and edit icon, something like this:
如何在Django管理面板中编辑字段

因此通常它应该添加图标和编辑图标,如下所示:

But the edit icon is missing.

但缺少编辑图标。

My model is as follows:

我的模型如下:

class BusinessUnit(models.Model):
    name = models.CharField(max_length=255)
    brands = models.ManyToManyField(to=Brand)
    site_picture = models.ImageField(upload_to=settings.MEDIA_ROOT, blank=True, null=True)
    address = models.ForeignKey(to=Address)

    def __unicode__(self):
        return self.name

And in admin.py i have the code as follows:

在admin.py中,我的代码如下:

class BusinessUnitAdmin(admin.ModelAdmin):
    search_fields = ('name',)
    list_display = ('name', 'address', )

admin.site.register(BusinessUnit, BusinessUnitAdmin)

Any ideas what is wrong?

有什么想法有什么不对?

1 个解决方案

#1


0  

According to this Ticket: https://code.djangoproject.com/ticket/13165, this was delivered on Django 1.8

根据这个Ticket:https://code.djangoproject.com/ticket/13165,这是在Django 1.8上发布的

#1


0  

According to this Ticket: https://code.djangoproject.com/ticket/13165, this was delivered on Django 1.8

根据这个Ticket:https://code.djangoproject.com/ticket/13165,这是在Django 1.8上发布的