Autocomplete for perf
This commit is contained in:
parent
c306113fbd
commit
9ae8bfbe3f
|
@ -16,6 +16,7 @@ class AuteurAdmin(VersionAdmin):
|
||||||
class MediaAdmin(VersionAdmin):
|
class MediaAdmin(VersionAdmin):
|
||||||
list_display = ('titre', 'authors', 'cote')
|
list_display = ('titre', 'authors', 'cote')
|
||||||
search_fields = ('titre', 'authors', 'cote')
|
search_fields = ('titre', 'authors', 'cote')
|
||||||
|
autocomplete_fields = ('auteur',)
|
||||||
|
|
||||||
def authors(self, obj):
|
def authors(self, obj):
|
||||||
return ", ".join([a.nom for a in obj.auteur.all()])
|
return ", ".join([a.nom for a in obj.auteur.all()])
|
||||||
|
@ -26,12 +27,15 @@ class EmpruntAdmin(VersionAdmin):
|
||||||
'permanencier_emprunt', 'permanencier_rendu')
|
'permanencier_emprunt', 'permanencier_rendu')
|
||||||
search_fields = ('media', 'user', 'date_emprunt', 'date_rendu')
|
search_fields = ('media', 'user', 'date_emprunt', 'date_rendu')
|
||||||
date_hierarchy = 'date_emprunt'
|
date_hierarchy = 'date_emprunt'
|
||||||
|
autocomplete_fields = ('media', 'user', 'permanencier_emprunt',
|
||||||
|
'permanencier_rendu')
|
||||||
|
|
||||||
|
|
||||||
class JeuAdmin(VersionAdmin):
|
class JeuAdmin(VersionAdmin):
|
||||||
list_display = ('nom', 'proprietaire', 'duree', 'nombre_joueurs_min',
|
list_display = ('nom', 'proprietaire', 'duree', 'nombre_joueurs_min',
|
||||||
'nombre_joueurs_max', 'comment')
|
'nombre_joueurs_max', 'comment')
|
||||||
search_fields = ('nom', 'proprietaire', 'duree', 'comment')
|
search_fields = ('nom', 'proprietaire', 'duree', 'comment')
|
||||||
|
autocomplete_fields = ('proprietaire',)
|
||||||
|
|
||||||
|
|
||||||
admin_site.register(Auteur, AuteurAdmin)
|
admin_site.register(Auteur, AuteurAdmin)
|
||||||
|
|
|
@ -20,10 +20,12 @@ class ClefAdmin(VersionAdmin):
|
||||||
list_display = ('nom', 'proprio', 'commentaire')
|
list_display = ('nom', 'proprio', 'commentaire')
|
||||||
ordering = ('nom',)
|
ordering = ('nom',)
|
||||||
search_fields = ('nom', 'proprio', 'commentaire')
|
search_fields = ('nom', 'proprio', 'commentaire')
|
||||||
|
autocomplete_fields = ('proprio',)
|
||||||
|
|
||||||
|
|
||||||
class AdhesionAdmin(VersionAdmin):
|
class AdhesionAdmin(VersionAdmin):
|
||||||
list_display = ('annee_debut', 'annee_fin')
|
list_display = ('annee_debut', 'annee_fin')
|
||||||
|
autocomplete_fields = ('adherent',)
|
||||||
|
|
||||||
|
|
||||||
class IsAdherentFilter(admin.SimpleListFilter):
|
class IsAdherentFilter(admin.SimpleListFilter):
|
||||||
|
|
Loading…
Reference in New Issue