Fix admin search fields
This commit is contained in:
		
							parent
							
								
									fd3ce87251
								
							
						
					
					
						commit
						53f28be5ec
					
				
					 3 changed files with 10 additions and 9 deletions
				
			
		| 
						 | 
					@ -15,7 +15,7 @@ class RegionAdmin(admin.ModelAdmin):
 | 
				
			||||||
class SiteAdmin(admin.ModelAdmin):
 | 
					class SiteAdmin(admin.ModelAdmin):
 | 
				
			||||||
    list_display = ('name', 'code', 'region', 'description', 'sort_order')
 | 
					    list_display = ('name', 'code', 'region', 'description', 'sort_order')
 | 
				
			||||||
    list_display_links = ('name',)
 | 
					    list_display_links = ('name',)
 | 
				
			||||||
    search_fields = ('name', 'code', 'region', 'description')
 | 
					    search_fields = ('name', 'code', 'region__name', 'description')
 | 
				
			||||||
    list_per_page = 25
 | 
					    list_per_page = 25
 | 
				
			||||||
    fields = ('name', 'code', 'region', 'description', 'sort_order')
 | 
					    fields = ('name', 'code', 'region', 'description', 'sort_order')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,7 +24,7 @@ class MunicipalLocationAdmin(admin.ModelAdmin):
 | 
				
			||||||
    list_display = ('name', 'code', 'site', 'municipal_location_type',
 | 
					    list_display = ('name', 'code', 'site', 'municipal_location_type',
 | 
				
			||||||
        'description', 'sort_order')
 | 
					        'description', 'sort_order')
 | 
				
			||||||
    list_display_links = ('name',)
 | 
					    list_display_links = ('name',)
 | 
				
			||||||
    search_fields = ('name', 'code', 'site', 'municipal_location_type',
 | 
					    search_fields = ('name', 'code', 'site__name', 'municipal_location_type',
 | 
				
			||||||
        'description')
 | 
					        'description')
 | 
				
			||||||
    list_per_page = 25
 | 
					    list_per_page = 25
 | 
				
			||||||
    fields = ('name', 'code', 'site', 'municipal_location_type',
 | 
					    fields = ('name', 'code', 'site', 'municipal_location_type',
 | 
				
			||||||
| 
						 | 
					@ -36,8 +36,8 @@ class StudyLocationAdmin(admin.ModelAdmin):
 | 
				
			||||||
        'treatment_type', 'municipal_location', 'collecting_location',
 | 
					        'treatment_type', 'municipal_location', 'collecting_location',
 | 
				
			||||||
        'description', 'sort_order')
 | 
					        'description', 'sort_order')
 | 
				
			||||||
    list_display_links = ('name',)
 | 
					    list_display_links = ('name',)
 | 
				
			||||||
    search_fields = ('name', 'code', 'site', 'study_location_type',
 | 
					    search_fields = ('name', 'code', 'site__name', 'study_location_type',
 | 
				
			||||||
        'treatment_type', 'municipal_location', 'collecting_location',
 | 
					        'treatment_type', 'municipal_location__name', 'collecting_location',
 | 
				
			||||||
        'description')
 | 
					        'description')
 | 
				
			||||||
    list_per_page = 25
 | 
					    list_per_page = 25
 | 
				
			||||||
    fields = ('name', 'code', 'site', 'study_location_type',
 | 
					    fields = ('name', 'code', 'site', 'study_location_type',
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -15,7 +15,8 @@ class MeasurementTypeAdmin(admin.ModelAdmin):
 | 
				
			||||||
    list_display = ('name', 'code', 'measurement_type_class', 'description',
 | 
					    list_display = ('name', 'code', 'measurement_type_class', 'description',
 | 
				
			||||||
        'default_measurement_unit', 'sort_order')
 | 
					        'default_measurement_unit', 'sort_order')
 | 
				
			||||||
    list_display_links = ('name',)
 | 
					    list_display_links = ('name',)
 | 
				
			||||||
    search_fields = ('name', 'code', 'measurement_type_class', 'description')
 | 
					    search_fields = ('name', 'code', 'measurement_type_class',
 | 
				
			||||||
 | 
					        'default_measurement_unit__code', 'description')
 | 
				
			||||||
    list_per_page = 25
 | 
					    list_per_page = 25
 | 
				
			||||||
    fields = ('name', 'code', 'measurement_type_class', 'description',
 | 
					    fields = ('name', 'code', 'measurement_type_class', 'description',
 | 
				
			||||||
        'default_measurement_unit', 'sort_order')
 | 
					        'default_measurement_unit', 'sort_order')
 | 
				
			||||||
| 
						 | 
					@ -25,8 +26,8 @@ class ContainerAdmin(admin.ModelAdmin):
 | 
				
			||||||
    list_display = ('name', 'code', 'application', 'color', 'material',
 | 
					    list_display = ('name', 'code', 'application', 'color', 'material',
 | 
				
			||||||
        'volume', 'measurement_unit', 'sort_order')
 | 
					        'volume', 'measurement_unit', 'sort_order')
 | 
				
			||||||
    list_display_links = ('name',)
 | 
					    list_display_links = ('name',)
 | 
				
			||||||
    search_fields = ('name', 'code', 'application', 'color', 'material',
 | 
					    search_fields = ('name', 'code', 'application', 'color__name',
 | 
				
			||||||
        'volume', 'measurement_unit')
 | 
					        'material__name', 'volume', 'measurement_unit__name')
 | 
				
			||||||
    list_per_page = 25
 | 
					    list_per_page = 25
 | 
				
			||||||
    fields = ('name', 'code', 'application', 'color', 'material',
 | 
					    fields = ('name', 'code', 'application', 'color', 'material',
 | 
				
			||||||
        'volume', 'measurement_unit', 'sort_order')
 | 
					        'volume', 'measurement_unit', 'sort_order')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -27,10 +27,10 @@ class GrantAdmin(admin.ModelAdmin):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class GrantReportAdmin(admin.ModelAdmin):
 | 
					class GrantReportAdmin(admin.ModelAdmin):
 | 
				
			||||||
    list_display = ('title', 'report_type', 'description', 'due_date',
 | 
					    list_display = ('grant', 'title', 'report_type', 'description', 'due_date',
 | 
				
			||||||
        'submitted_date', 'attachment', 'sort_order')
 | 
					        'submitted_date', 'attachment', 'sort_order')
 | 
				
			||||||
    list_display_links = ('title',)
 | 
					    list_display_links = ('title',)
 | 
				
			||||||
    search_fields = ('title', 'report_type', 'description', 'due_date',
 | 
					    search_fields = ('grant__title', 'title', 'report_type', 'description', 'due_date',
 | 
				
			||||||
        'submitted_date', 'attachment')
 | 
					        'submitted_date', 'attachment')
 | 
				
			||||||
    list_per_page = 25
 | 
					    list_per_page = 25
 | 
				
			||||||
    fields = ('title', 'report_type', 'description', 'due_date',
 | 
					    fields = ('title', 'report_type', 'description', 'due_date',
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue