From 89590b88de230986aae763db8dedbe519d59cd7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Wed, 13 Jul 2016 01:01:07 +0200 Subject: [PATCH] =?UTF-8?q?=C3=89tend=20les=20champs=20de=20recherche=20da?= =?UTF-8?q?ns=20l'admin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #24 --- bda/admin.py | 11 +++++++++-- gestioncof/admin.py | 10 ++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/bda/admin.py b/bda/admin.py index 26d9a865..d989295d 100644 --- a/bda/admin.py +++ b/bda/admin.py @@ -174,7 +174,8 @@ class ChoixSpectacleAdmin(admin.ModelAdmin): list_filter = ("double_choice", "participant__tirage") search_fields = ('participant__user__username', 'participant__user__first_name', - 'participant__user__last_name') + 'participant__user__last_name', + 'spectacle__title') class SpectacleAdmin(admin.ModelAdmin): @@ -193,8 +194,14 @@ class TirageAdmin(admin.ModelAdmin): list_filter = ("active", ) search_fields = ("title", ) + +class SalleAdmin(admin.ModelAdmin): + model = Salle + search_fields = ('name', 'address') + + admin.site.register(Spectacle, SpectacleAdmin) -admin.site.register(Salle) +admin.site.register(Salle, SalleAdmin) admin.site.register(Participant, ParticipantAdmin) admin.site.register(Attribution, AttributionAdmin) admin.site.register(ChoixSpectacle, ChoixSpectacleAdmin) diff --git a/gestioncof/admin.py b/gestioncof/admin.py index bb03bbd4..8a1fb431 100644 --- a/gestioncof/admin.py +++ b/gestioncof/admin.py @@ -46,12 +46,14 @@ class SurveyQuestionInline(admin.TabularInline): class SurveyQuestionAdmin(admin.ModelAdmin): + search_fields = ('survey__title', 'answer') inlines = [ SurveyQuestionAnswerInline, ] class SurveyAdmin(admin.ModelAdmin): + search_fields = ('title', 'details') inlines = [ SurveyQuestionInline, ] @@ -72,12 +74,14 @@ class EventCommentFieldInline(admin.TabularInline): class EventOptionAdmin(admin.ModelAdmin): + search_fields = ('event__title', 'name') inlines = [ EventOptionChoiceInline, ] class EventAdmin(admin.ModelAdmin): + search_fields = ('title', 'location', 'description') inlines = [ EventOptionInline, EventCommentFieldInline, @@ -189,6 +193,7 @@ class PetitCoursAbilityAdmin(admin.ModelAdmin): class PetitCoursAttributionAdmin(admin.ModelAdmin): list_display = ('user', 'demande', 'matiere', 'rank', ) + search_fields = ('user__username', 'matiere__name') class PetitCoursAttributionCounterAdmin(admin.ModelAdmin): @@ -208,6 +213,11 @@ class PetitCoursDemandeAdmin(admin.ModelAdmin): list_display = ('name', 'email', 'agrege_requis', 'niveau', 'created', 'traitee', 'processed') list_filter = ('traitee', 'niveau') + search_fields = ('name', 'email', 'phone', 'lieu', 'remarques') + + +class CustomMailAdmin(admin.ModelAdmin): + search_fields = ('shortname', 'title') admin.site.register(Survey, SurveyAdmin) admin.site.register(SurveyQuestion, SurveyQuestionAdmin)