2

I use grappelli for django admin. I have simple Blog model:

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)

In standart admin I have delete checkbox near each blogpost in the category. But then I turn on grappelli, this checkboxes disappear. How can I get them back? Thx!

karthikr
  • 97,368
  • 26
  • 197
  • 188
Wolter
  • 1,053
  • 3
  • 11
  • 17

0 Answers0