admin search fields

This commit is contained in:
Qwann 2018-08-09 16:14:28 +02:00
parent 14728c8513
commit 6e993c0e27

View file

@ -63,13 +63,16 @@ class EquipmentAttributeValueInline(admin.TabularInline):
class CategoryAdmin(admin.ModelAdmin): class CategoryAdmin(admin.ModelAdmin):
readonly_fields = ['full_name']
list_display = ['name', 'parent', "full_name"] list_display = ['name', 'parent', "full_name"]
ordering = ['name', 'parent'] ordering = ['name', 'parent']
search_fields = ['name',]
class EquipmentAttributeAdmin(admin.ModelAdmin): class EquipmentAttributeAdmin(admin.ModelAdmin):
list_display = ['name'] list_display = ['name']
ordering = ['name'] ordering = ['name']
search_fields = ['name',]
class EquipmentAdmin(admin.ModelAdmin): class EquipmentAdmin(admin.ModelAdmin):
@ -80,6 +83,7 @@ class EquipmentAdmin(admin.ModelAdmin):
EquipmentDefaultExtraInline, EquipmentDefaultExtraInline,
EquipmentLostExtraInline, EquipmentLostExtraInline,
EquipmentRevisionExtraInline] EquipmentRevisionExtraInline]
search_fields = ['name', 'description',]
admin_site.register(Equipment, EquipmentAdmin) admin_site.register(Equipment, EquipmentAdmin)