Commits

Anonymous committed 242b650

Prepopulate slug field on inlines
Allow filtering questions by category

  • Participants
  • Parent commits 33e3376

Comments (0)

Files changed (1)

File gnocchi_faq/admin.py

 
 class QuestionInline(admin.StackedInline):
     model = models.Question
+    prepopulated_fields = {
+        'slug': ('question',)
+    }
 
 class CategoryAdmin(admin.ModelAdmin):
     list_display = ('title', 'order',)
 class QuestionAdmin(admin.ModelAdmin):
     list_display = ('question', 'category', 'order', 'is_published',)
     list_editable = ('order', 'is_published',)
+    list_filter = ('category', 'is_published',)
     prepopulated_fields = {
         'slug': ('question',)
     }