from django.contrib import admin
from .models import Report

class ReportAdmin(admin.ModelAdmin):
    list_display = ('addressed_to', 'reported_from', 'content', 'signed_from', 'get_copies', 'created_at')
    list_filter = ['created_at']
    search_fields = ['addressed_to', 'reported_from', 'content', 'signed_from']

admin.site.register(Report, ReportAdmin)

from django.contrib import admin
from .models import Report

class ReportAdmin(admin.ModelAdmin):
    list_display = ('addressed_to', 'reported_from', 'content', 'signed_from', 'get_copies', 'created_at')
    list_filter = ['created_at', 'content']
    search_fields = ['addressed_to', 'reported_from__username', 'content', 'signed_from']

admin.site.register(Report, ReportAdmin)

Fix some issues, because of models change
Fix some issues, because of models change

  from django.contrib import admin
  from .models import Report
  
  class ReportAdmin(admin.ModelAdmin):
      list_display = ('addressed_to', 'reported_from', 'content', 'signed_from', 'get_copies', 'created_at')
-     list_filter = ['created_at']
+     list_filter = ['created_at', 'content']
-     search_fields = ['addressed_to', 'reported_from', 'content', 'signed_from']
+     search_fields = ['addressed_to', 'reported_from__username', 'content', 'signed_from']
  
  admin.site.register(Report, ReportAdmin)
  
Fix some issues, because of models change
## Code Before:
from django.contrib import admin
from .models import Report

class ReportAdmin(admin.ModelAdmin):
    list_display = ('addressed_to', 'reported_from', 'content', 'signed_from', 'get_copies', 'created_at')
    list_filter = ['created_at']
    search_fields = ['addressed_to', 'reported_from', 'content', 'signed_from']

admin.site.register(Report, ReportAdmin)

## Instruction:
Fix some issues, because of models change
## Code After:
from django.contrib import admin
from .models import Report

class ReportAdmin(admin.ModelAdmin):
    list_display = ('addressed_to', 'reported_from', 'content', 'signed_from', 'get_copies', 'created_at')
    list_filter = ['created_at', 'content']
    search_fields = ['addressed_to', 'reported_from__username', 'content', 'signed_from']

admin.site.register(Report, ReportAdmin)
