diff --git a/calendrier/admin.py b/calendrier/admin.py index a8477d0..f48de3f 100644 --- a/calendrier/admin.py +++ b/calendrier/admin.py @@ -2,5 +2,15 @@ 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..be35fd7 100644 --- a/gestion/admin.py +++ b/gestion/admin.py @@ -114,8 +114,19 @@ class UserProfileAdmin(UserAdmin): 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)