from django.contrib import admin
from froide.publicbody.models import PublicBody, FoiLaw

class PublicBodyAdmin(admin.ModelAdmin):
    prepopulated_fields = {"slug": ("geography", "name",)}
    list_display = ('name', 'classification', 'geography')
    list_filter = ('classification',)
    search_fields = ['name', "description"]
    exclude = ('confirmed',)

class FoiLawAdmin(admin.ModelAdmin):
    prepopulated_fields = {"slug": ("jurisdiction", "name",)}

admin.site.register(PublicBody, PublicBodyAdmin)
admin.site.register(FoiLaw, FoiLawAdmin)

from django.contrib import admin
from froide.publicbody.models import PublicBody, FoiLaw

class PublicBodyAdmin(admin.ModelAdmin):
    prepopulated_fields = {"slug": ("geography", "name",)}
    list_display = ('name', 'classification', 'topic', 'geography')
    list_filter = ('classification', 'topic',)
    search_fields = ['name', "description"]
    exclude = ('confirmed',)

class FoiLawAdmin(admin.ModelAdmin):
    prepopulated_fields = {"slug": ("jurisdiction", "name",)}

admin.site.register(PublicBody, PublicBodyAdmin)
admin.site.register(FoiLaw, FoiLawAdmin)

Add topic to PublicBodyAdmin list_filter and list_display
Add topic to PublicBodyAdmin list_filter and list_display
  from django.contrib import admin
  from froide.publicbody.models import PublicBody, FoiLaw
  
  class PublicBodyAdmin(admin.ModelAdmin):
      prepopulated_fields = {"slug": ("geography", "name",)}
-     list_display = ('name', 'classification', 'geography')
+     list_display = ('name', 'classification', 'topic', 'geography')
-     list_filter = ('classification',)
+     list_filter = ('classification', 'topic',)
      search_fields = ['name', "description"]
      exclude = ('confirmed',)
  
  class FoiLawAdmin(admin.ModelAdmin):
      prepopulated_fields = {"slug": ("jurisdiction", "name",)}
  
  admin.site.register(PublicBody, PublicBodyAdmin)
  admin.site.register(FoiLaw, FoiLawAdmin)
  
Add topic to PublicBodyAdmin list_filter and list_display
## Code Before:
from django.contrib import admin
from froide.publicbody.models import PublicBody, FoiLaw

class PublicBodyAdmin(admin.ModelAdmin):
    prepopulated_fields = {"slug": ("geography", "name",)}
    list_display = ('name', 'classification', 'geography')
    list_filter = ('classification',)
    search_fields = ['name', "description"]
    exclude = ('confirmed',)

class FoiLawAdmin(admin.ModelAdmin):
    prepopulated_fields = {"slug": ("jurisdiction", "name",)}

admin.site.register(PublicBody, PublicBodyAdmin)
admin.site.register(FoiLaw, FoiLawAdmin)

## Instruction:
Add topic to PublicBodyAdmin list_filter and list_display
## Code After:
from django.contrib import admin
from froide.publicbody.models import PublicBody, FoiLaw

class PublicBodyAdmin(admin.ModelAdmin):
    prepopulated_fields = {"slug": ("geography", "name",)}
    list_display = ('name', 'classification', 'topic', 'geography')
    list_filter = ('classification', 'topic',)
    search_fields = ['name', "description"]
    exclude = ('confirmed',)

class FoiLawAdmin(admin.ModelAdmin):
    prepopulated_fields = {"slug": ("jurisdiction", "name",)}

admin.site.register(PublicBody, PublicBodyAdmin)
admin.site.register(FoiLaw, FoiLawAdmin)
