prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Improve annotation admin pages
  The graders have asked me to delete all annotations for one user for a specific image. There is currently no easy way to do this in the admin pages. I will need to find a way to make this possible. Probably by adding certain search_fields or list_filters.
  
  Also, I have noticed that some admin pages take extremely long to load. For example the change page for a polygon annotation set. I think this happens because it has to load a lot of data which it does not do efficiently and because it makes all inline model fields are editable by default. It will most likely never happen that we need to change this data manually so those fields can all be set to read_only. It might also be better to just have some statistics there about the number of inline models and not show the actual inline models at all.
  Example loading time for an admin page:
  ![image](https://user-images.githubusercontent.com/2001094/73462398-08bf9380-437c-11ea-9116-a6170c114176.png)
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `app/grandchallenge/annotations/admin.py`
  Content:
  ```
  1 from django.contrib import admin
  2 
  3 from grandchallenge.annotations.models import (
  4     BooleanClassificationAnnotation,
  5     ETDRSGridAnnotation,
  6     LandmarkAnnotationSet,
  7     MeasurementAnnotation,
  8     PolygonAnnotationSet,
  9     SingleLandmarkAnnotation,
  10     SinglePolygonAnnotation,
  11 )
  12 
  13 
  14 class BooleanClassificationAnnotationAdmin(admin.ModelAdmin):
  15     search_fields = ("grader__username", "name", "created")
  16     list_filter = ("created", "value", "name")
  17 
  18 
  19 class SinglePolygonAnnotationInline(admin.StackedInline):
  20     model = SinglePolygonAnnotation
  21     extra = 0
  22 
  23 
  24 class PolygonAnnotationSetAdmin(admin.ModelAdmin):
  25     search_fields = ("grader__username", "created", "name")
  26     list_filter = ("created", "grader__username", "name")
  27     inlines = [SinglePolygonAnnotationInline]
  28 
  29 
  30 class SingleLandmarkAnnotationInline(admin.StackedInline):
  31     model = SingleLandmarkAnnotation
  32     extra = 0
  33 
  34 
  35 class LandmarkAnnotationSetAdmin(admin.ModelAdmin):
  36     search_fields = ("grader__username", "created")
  37     list_filter = ("created", "grader__username")
  38     inlines = [SingleLandmarkAnnotationInline]
  39 
  40 
  41 admin.site.register(ETDRSGridAnnotation)
  42 admin.site.register(MeasurementAnnotation)
  43 admin.site.register(
  44     BooleanClassificationAnnotation, BooleanClassificationAnnotationAdmin
  45 )
  46 admin.site.register(PolygonAnnotationSet, PolygonAnnotationSetAdmin)
  47 admin.site.register(SinglePolygonAnnotation)
  48 admin.site.register(LandmarkAnnotationSet, LandmarkAnnotationSetAdmin)
  49 admin.site.register(SingleLandmarkAnnotation)
  50
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/app/grandchallenge/annotations/admin.py b/app/grandchallenge/annotations/admin.py
  --- a/app/grandchallenge/annotations/admin.py
  +++ b/app/grandchallenge/annotations/admin.py
  @@ -19,23 +19,33 @@
   class SinglePolygonAnnotationInline(admin.StackedInline):
       model = SinglePolygonAnnotation
       extra = 0
  +    readonly_fields = (
  +        "annotation_set",
  +        "value",
  +        "x_axis_orientation",
  +        "y_axis_orientation",
  +        "z",
  +    )
   
   
   class PolygonAnnotationSetAdmin(admin.ModelAdmin):
  -    search_fields = ("grader__username", "created", "name")
  +    search_fields = ("grader__username", "created", "name", "image__name")
       list_filter = ("created", "grader__username", "name")
       inlines = [SinglePolygonAnnotationInline]
  +    readonly_fields = ("grader", "image", "name", "created")
   
   
   class SingleLandmarkAnnotationInline(admin.StackedInline):
       model = SingleLandmarkAnnotation
       extra = 0
  +    readonly_fields = ("image", "landmarks")
   
   
   class LandmarkAnnotationSetAdmin(admin.ModelAdmin):
       search_fields = ("grader__username", "created")
       list_filter = ("created", "grader__username")
       inlines = [SingleLandmarkAnnotationInline]
  +    readonly_fields = ("grader", "created")
   
   
   admin.site.register(ETDRSGridAnnotation)
  
verification_info: {"golden_diff": "diff --git a/app/grandchallenge/annotations/admin.py b/app/grandchallenge/annotations/admin.py\n--- a/app/grandchallenge/annotations/admin.py\n+++ b/app/grandchallenge/annotations/admin.py\n@@ -19,23 +19,33 @@\n class SinglePolygonAnnotationInline(admin.StackedInline):\n     model = SinglePolygonAnnotation\n     extra = 0\n+    readonly_fields = (\n+        \"annotation_set\",\n+        \"value\",\n+        \"x_axis_orientation\",\n+        \"y_axis_orientation\",\n+        \"z\",\n+    )\n \n \n class PolygonAnnotationSetAdmin(admin.ModelAdmin):\n-    search_fields = (\"grader__username\", \"created\", \"name\")\n+    search_fields = (\"grader__username\", \"created\", \"name\", \"image__name\")\n     list_filter = (\"created\", \"grader__username\", \"name\")\n     inlines = [SinglePolygonAnnotationInline]\n+    readonly_fields = (\"grader\", \"image\", \"name\", \"created\")\n \n \n class SingleLandmarkAnnotationInline(admin.StackedInline):\n     model = SingleLandmarkAnnotation\n     extra = 0\n+    readonly_fields = (\"image\", \"landmarks\")\n \n \n class LandmarkAnnotationSetAdmin(admin.ModelAdmin):\n     search_fields = (\"grader__username\", \"created\")\n     list_filter = (\"created\", \"grader__username\")\n     inlines = [SingleLandmarkAnnotationInline]\n+    readonly_fields = (\"grader\", \"created\")\n \n \n admin.site.register(ETDRSGridAnnotation)\n", "issue": "Improve annotation admin pages\nThe graders have asked me to delete all annotations for one user for a specific image. There is currently no easy way to do this in the admin pages. I will need to find a way to make this possible. Probably by adding certain search_fields or list_filters.\r\n\r\nAlso, I have noticed that some admin pages take extremely long to load. For example the change page for a polygon annotation set. I think this happens because it has to load a lot of data which it does not do efficiently and because it makes all inline model fields are editable by default. It will most likely never happen that we need to change this data manually so those fields can all be set to read_only. It might also be better to just have some statistics there about the number of inline models and not show the actual inline models at all.\r\nExample loading time for an admin page:\r\n![image](https://user-images.githubusercontent.com/2001094/73462398-08bf9380-437c-11ea-9116-a6170c114176.png)\r\n\n", "before_files": [{"content": "from django.contrib import admin\n\nfrom grandchallenge.annotations.models import (\n    BooleanClassificationAnnotation,\n    ETDRSGridAnnotation,\n    LandmarkAnnotationSet,\n    MeasurementAnnotation,\n    PolygonAnnotationSet,\n    SingleLandmarkAnnotation,\n    SinglePolygonAnnotation,\n)\n\n\nclass BooleanClassificationAnnotationAdmin(admin.ModelAdmin):\n    search_fields = (\"grader__username\", \"name\", \"created\")\n    list_filter = (\"created\", \"value\", \"name\")\n\n\nclass SinglePolygonAnnotationInline(admin.StackedInline):\n    model = SinglePolygonAnnotation\n    extra = 0\n\n\nclass PolygonAnnotationSetAdmin(admin.ModelAdmin):\n    search_fields = (\"grader__username\", \"created\", \"name\")\n    list_filter = (\"created\", \"grader__username\", \"name\")\n    inlines = [SinglePolygonAnnotationInline]\n\n\nclass SingleLandmarkAnnotationInline(admin.StackedInline):\n    model = SingleLandmarkAnnotation\n    extra = 0\n\n\nclass LandmarkAnnotationSetAdmin(admin.ModelAdmin):\n    search_fields = (\"grader__username\", \"created\")\n    list_filter = (\"created\", \"grader__username\")\n    inlines = [SingleLandmarkAnnotationInline]\n\n\nadmin.site.register(ETDRSGridAnnotation)\nadmin.site.register(MeasurementAnnotation)\nadmin.site.register(\n    BooleanClassificationAnnotation, BooleanClassificationAnnotationAdmin\n)\nadmin.site.register(PolygonAnnotationSet, PolygonAnnotationSetAdmin)\nadmin.site.register(SinglePolygonAnnotation)\nadmin.site.register(LandmarkAnnotationSet, LandmarkAnnotationSetAdmin)\nadmin.site.register(SingleLandmarkAnnotation)\n", "path": "app/grandchallenge/annotations/admin.py"}], "after_files": [{"content": "from django.contrib import admin\n\nfrom grandchallenge.annotations.models import (\n    BooleanClassificationAnnotation,\n    ETDRSGridAnnotation,\n    LandmarkAnnotationSet,\n    MeasurementAnnotation,\n    PolygonAnnotationSet,\n    SingleLandmarkAnnotation,\n    SinglePolygonAnnotation,\n)\n\n\nclass BooleanClassificationAnnotationAdmin(admin.ModelAdmin):\n    search_fields = (\"grader__username\", \"name\", \"created\")\n    list_filter = (\"created\", \"value\", \"name\")\n\n\nclass SinglePolygonAnnotationInline(admin.StackedInline):\n    model = SinglePolygonAnnotation\n    extra = 0\n    readonly_fields = (\n        \"annotation_set\",\n        \"value\",\n        \"x_axis_orientation\",\n        \"y_axis_orientation\",\n        \"z\",\n    )\n\n\nclass PolygonAnnotationSetAdmin(admin.ModelAdmin):\n    search_fields = (\"grader__username\", \"created\", \"name\", \"image__name\")\n    list_filter = (\"created\", \"grader__username\", \"name\")\n    inlines = [SinglePolygonAnnotationInline]\n    readonly_fields = (\"grader\", \"image\", \"name\", \"created\")\n\n\nclass SingleLandmarkAnnotationInline(admin.StackedInline):\n    model = SingleLandmarkAnnotation\n    extra = 0\n    readonly_fields = (\"image\", \"landmarks\")\n\n\nclass LandmarkAnnotationSetAdmin(admin.ModelAdmin):\n    search_fields = (\"grader__username\", \"created\")\n    list_filter = (\"created\", \"grader__username\")\n    inlines = [SingleLandmarkAnnotationInline]\n    readonly_fields = (\"grader\", \"created\")\n\n\nadmin.site.register(ETDRSGridAnnotation)\nadmin.site.register(MeasurementAnnotation)\nadmin.site.register(\n    BooleanClassificationAnnotation, BooleanClassificationAnnotationAdmin\n)\nadmin.site.register(PolygonAnnotationSet, PolygonAnnotationSetAdmin)\nadmin.site.register(SinglePolygonAnnotation)\nadmin.site.register(LandmarkAnnotationSet, LandmarkAnnotationSetAdmin)\nadmin.site.register(SingleLandmarkAnnotation)\n", "path": "app/grandchallenge/annotations/admin.py"}]}