mirror of
https://gitlab.crans.org/mediatek/med.git
synced 2024-12-24 17:42:23 +00:00
Fix search
This commit is contained in:
parent
9ae8bfbe3f
commit
82ebc60982
@ -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',)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user