from django.contrib import admin
from forum.models import Category, Forum, Thread

admin.site.register(Category)
admin.site.register(Forum)
admin.site.register(Thread)

from django.contrib import admin
from forum.models import Category, Forum, Thread

class ForumInline(admin.StackedInline):
    model = Forum

class CategoryAdmin(admin.ModelAdmin):
    inlines = [ForumInline]

admin.site.register(Category, CategoryAdmin)
admin.site.register(Thread)

Modify forums directly in categories.
Modify forums directly in categories.

  from django.contrib import admin
  from forum.models import Category, Forum, Thread
  
+ class ForumInline(admin.StackedInline):
+     model = Forum
+ 
+ class CategoryAdmin(admin.ModelAdmin):
+     inlines = [ForumInline]
+ 
- admin.site.register(Category)
+ admin.site.register(Category, CategoryAdmin)
- admin.site.register(Forum)
  admin.site.register(Thread)
  
Modify forums directly in categories.
## Code Before:
from django.contrib import admin
from forum.models import Category, Forum, Thread

admin.site.register(Category)
admin.site.register(Forum)
admin.site.register(Thread)

## Instruction:
Modify forums directly in categories.
## Code After:
from django.contrib import admin
from forum.models import Category, Forum, Thread

class ForumInline(admin.StackedInline):
    model = Forum

class CategoryAdmin(admin.ModelAdmin):
    inlines = [ForumInline]

admin.site.register(Category, CategoryAdmin)
admin.site.register(Thread)
