From b49accf96e3ae26c8ca5b37e9f807ed80c666500 Mon Sep 17 00:00:00 2001 From: Maurice Debray Date: Sat, 26 Feb 2022 12:40:56 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Repondre=20=C3=A0=20la=20place=20des=20fanf?= =?UTF-8?q?arons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- calendrier/admin.py | 10 +++++++++- gestion/admin.py | 10 ++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/calendrier/admin.py b/calendrier/admin.py index a8477d0..fdfbf43 100644 --- a/calendrier/admin.py +++ b/calendrier/admin.py @@ -3,4 +3,12 @@ from django.contrib import admin from .models import Event, Participants # Add event by admin page return a 502 error -admin.site.register(Event) +class ParticipantsAdmin(admin.ModelAdmin): + autocomplete_fields = [ "event", "participant" ] + +class EventAdmin(admin.ModelAdmin): + search_fields = [ "nom", "nomcourt", "lieu", "description", "desc_users" ] + +admin.site.register(Event, EventAdmin) +admin.site.register(Participants, ParticipantsAdmin) + diff --git a/gestion/admin.py b/gestion/admin.py index 79f1e64..322896c 100644 --- a/gestion/admin.py +++ b/gestion/admin.py @@ -113,9 +113,19 @@ class UserProfileAdmin(UserAdmin): user.groups.add(chef_group) user.save() +class ErnestoUserAdmin(admin.ModelAdmin): + search_fields = [ + "user__username", + "user__first_name", + "user__last_name", + "phone", + "instru", + ] + admin.site.unregister(User) admin.site.register(User, UserProfileAdmin) +admin.site.register(ErnestoUser, ErnestoUserAdmin) admin.site.register(VideoGallery) admin.site.register(Photo) admin.site.register(Actu) -- 2.47.0 From 84af71a6c7d817ae66ad17a236d8cc7e56349f24 Mon Sep 17 00:00:00 2001 From: Maurice Debray Date: Sat, 26 Feb 2022 12:44:47 +0100 Subject: [PATCH 2/2] linting --- calendrier/admin.py | 8 +++++--- gestion/admin.py | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/calendrier/admin.py b/calendrier/admin.py index fdfbf43..f48de3f 100644 --- a/calendrier/admin.py +++ b/calendrier/admin.py @@ -2,13 +2,15 @@ from django.contrib import admin from .models import Event, Participants + # Add event by admin page return a 502 error class ParticipantsAdmin(admin.ModelAdmin): - autocomplete_fields = [ "event", "participant" ] + autocomplete_fields = ["event", "participant"] + class EventAdmin(admin.ModelAdmin): - search_fields = [ "nom", "nomcourt", "lieu", "description", "desc_users" ] + search_fields = ["nom", "nomcourt", "lieu", "description", "desc_users"] + admin.site.register(Event, EventAdmin) admin.site.register(Participants, ParticipantsAdmin) - diff --git a/gestion/admin.py b/gestion/admin.py index 322896c..be35fd7 100644 --- a/gestion/admin.py +++ b/gestion/admin.py @@ -113,8 +113,9 @@ class UserProfileAdmin(UserAdmin): user.groups.add(chef_group) user.save() + class ErnestoUserAdmin(admin.ModelAdmin): - search_fields = [ + search_fields = [ "user__username", "user__first_name", "user__last_name", -- 2.47.0