Commit 82ebc609 authored by erdnaxe's avatar erdnaxe 🎇

Fix search

parent 9ae8bfbe
Pipeline #1411 passed with stage
in 3 minutes and 19 seconds
......@@ -15,7 +15,7 @@ class AuteurAdmin(VersionAdmin):
class MediaAdmin(VersionAdmin):
list_display = ('titre', 'authors', 'cote')
search_fields = ('titre', 'authors', 'cote')
search_fields = ('titre', 'auteur__nom', 'cote')
autocomplete_fields = ('auteur',)
def authors(self, obj):
......@@ -25,7 +25,8 @@ class MediaAdmin(VersionAdmin):
class EmpruntAdmin(VersionAdmin):
list_display = ('media', 'user', 'date_emprunt', 'date_rendu',
'permanencier_emprunt', 'permanencier_rendu')
search_fields = ('media', 'user', 'date_emprunt', 'date_rendu')
search_fields = ('media__titre', 'media__cote', 'user__username',
'date_emprunt', 'date_rendu')
date_hierarchy = 'date_emprunt'
autocomplete_fields = ('media', 'user', 'permanencier_emprunt',
'permanencier_rendu')
......@@ -34,7 +35,7 @@ class EmpruntAdmin(VersionAdmin):
class JeuAdmin(VersionAdmin):
list_display = ('nom', 'proprietaire', 'duree', 'nombre_joueurs_min',
'nombre_joueurs_max', 'comment')
search_fields = ('nom', 'proprietaire', 'duree', 'comment')
search_fields = ('nom', 'proprietaire__username', 'duree', 'comment')
autocomplete_fields = ('proprietaire',)
......
......@@ -19,7 +19,7 @@ from .models import Adhesion, Clef, User
class ClefAdmin(VersionAdmin):
list_display = ('nom', 'proprio', 'commentaire')
ordering = ('nom',)
search_fields = ('nom', 'proprio', 'commentaire')
search_fields = ('nom', 'proprio__username', 'commentaire')
autocomplete_fields = ('proprio',)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment