from django.contrib.gis import admin
from uscampgrounds.models import *

class CampgroundAdmin(admin.OSMGeoAdmin):
    list_display = ('name', 'campground_code', 'campground_type', 'phone', 'sites', 'elevation', 'hookups', 'amenities')
    list_filter = ('campground_type',)

admin.site.register(Campground, CampgroundAdmin)

from django.contrib.gis import admin
from uscampgrounds.models import *

class CampgroundAdmin(admin.OSMGeoAdmin):
    list_display = ('name', 'campground_code', 'campground_type', 'phone', 'sites', 'elevation', 'hookups', 'amenities')
    list_filter = ('campground_type',)
    search_fields = ('name',)

admin.site.register(Campground, CampgroundAdmin)

Allow searching campgrounds by name for convenience.
Allow searching campgrounds by name for convenience.

  from django.contrib.gis import admin
  from uscampgrounds.models import *
  
  class CampgroundAdmin(admin.OSMGeoAdmin):
      list_display = ('name', 'campground_code', 'campground_type', 'phone', 'sites', 'elevation', 'hookups', 'amenities')
      list_filter = ('campground_type',)
+     search_fields = ('name',)
  
  admin.site.register(Campground, CampgroundAdmin)
  
Allow searching campgrounds by name for convenience.
## Code Before:
from django.contrib.gis import admin
from uscampgrounds.models import *

class CampgroundAdmin(admin.OSMGeoAdmin):
    list_display = ('name', 'campground_code', 'campground_type', 'phone', 'sites', 'elevation', 'hookups', 'amenities')
    list_filter = ('campground_type',)

admin.site.register(Campground, CampgroundAdmin)

## Instruction:
Allow searching campgrounds by name for convenience.
## Code After:
from django.contrib.gis import admin
from uscampgrounds.models import *

class CampgroundAdmin(admin.OSMGeoAdmin):
    list_display = ('name', 'campground_code', 'campground_type', 'phone', 'sites', 'elevation', 'hookups', 'amenities')
    list_filter = ('campground_type',)
    search_fields = ('name',)

admin.site.register(Campground, CampgroundAdmin)
