Browse Source

améliorations recherche

Élie Bouttier 7 years ago
parent
commit
5513cdcbe3
2 changed files with 3 additions and 3 deletions
  1. 1 1
      adhesions/admin.py
  2. 2 2
      services/admin.py

+ 1 - 1
adhesions/admin.py

@@ -156,7 +156,7 @@ class AdhesionAdmin(admin.ModelAdmin):
     list_filter = (AdherentTypeFilter,)
     fields = ('id', 'type', 'get_adherent_link', 'notes')
     readonly_fields = ('id', 'type', 'get_adherent_link',)
-    search_fields = ('id', 'notes',)
+    search_fields = ('=id', 'notes',)
     inlines = (ServiceInline,)#PaymentInline,)
 
     def get_id(self, obj):

+ 2 - 2
services/admin.py

@@ -121,7 +121,7 @@ class ServiceAdmin(admin.ModelAdmin):
         ('service_type', admin.RelatedOnlyFieldListFilter),
     )
     inlines = (ServiceAllocationInline,)
-    search_fields = ('id', 'service_type__name', 'label', 'adhesion__id',)
+    search_fields = ('=id', 'service_type__name', 'label', 'notes',)
     raw_id_fields = ('adhesion',)
 
     get_adhesion_link = lambda self, service: service.adhesion.get_adhesion_link()
@@ -149,7 +149,7 @@ class IPResourceAdmin(admin.ModelAdmin):
     )
     fields = ('ip', 'reserved', 'notes')
     readonly_fields = ('ip', 'reserved',)
-    search_fields = ('ip',)
+    search_fields = ('=ip',)
 
     def get_inline_instances(self, request, obj=None):
         if obj: