我使用grappelli为django admin。 我有简单的博客模型:
class Blog(models.Model):
title = models.CharField(max_length=100, unique=True)
slug = models.SlugField(max_length=100, unique=True)
body = models.TextField()
timestamp=models.DateTimeField(db_index=True)
category = models.ForeignKey('auto.Category')
class Meta:
ordering=('-timestamp',)
class Category(models.Model):
title = models.CharField(max_length=100, db_index=True)
slug = models.SlugField(max_length=100, db_index=True)
admin.py
class BlogInline(admin.TabularInline):
list_display=('title', 'timestamp')
prepopulated_fields = {'slug': ('title',)}
model = Blog
class CategoryAdmin(admin.ModelAdmin):
prepopulated_fields = {'slug': ('title',)}
inlines = [BlogInline,]
admin.site.register(Category, CategoryAdmin)
在标准管理员中,我在类别中的每个博客帖子附近都有删除复选框。但随后我打开grappelli,这个复选框消失了。我怎样才能让他们回来? THX!