From bf0a29655ab906c994fc6a0ccfa458251be3bda5 Mon Sep 17 00:00:00 2001 From: Basile Clement Date: Tue, 24 May 2016 00:25:06 +0200 Subject: [PATCH] modelform_factory requires fields or exclude (django 1.8) --- bda/admin.py | 2 +- bda2/admin.py | 2 +- bda3/admin.py | 2 +- gestioncof/admin.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bda/admin.py b/bda/admin.py index 1a419dc4..7139fe58 100644 --- a/bda/admin.py +++ b/bda/admin.py @@ -139,7 +139,7 @@ class AttributionAdmin(admin.ModelAdmin): import autocomplete_light class ChoixSpectacleAdmin(admin.ModelAdmin): - form = autocomplete_light.modelform_factory(ChoixSpectacle) + form = autocomplete_light.modelform_factory(ChoixSpectacle, exclude=[]) list_display = ("participant", "spectacle", "priority", "double_choice") list_filter = ("double_choice",) search_fields = ('participant__user__username', 'participant__user__first_name', 'participant__user__last_name') diff --git a/bda2/admin.py b/bda2/admin.py index 32325b0b..854bfb74 100644 --- a/bda2/admin.py +++ b/bda2/admin.py @@ -159,7 +159,7 @@ class AttributionAdmin(admin.ModelAdmin): import autocomplete_light class ChoixSpectacleAdmin(admin.ModelAdmin): - form = autocomplete_light.modelform_factory(ChoixSpectacle) + form = autocomplete_light.modelform_factory(ChoixSpectacle, exclude=[]) list_display = ("participant", "spectacle", "priority", "double", "autoquit") list_filter = ("double", "autoquit") search_fields = ('participant__user__username', 'participant__user__first_name', 'participant__user__last_name') diff --git a/bda3/admin.py b/bda3/admin.py index a4c7b05a..ffcaea86 100644 --- a/bda3/admin.py +++ b/bda3/admin.py @@ -162,7 +162,7 @@ class AttributionAdmin(admin.ModelAdmin): import autocomplete_light class ChoixSpectacleAdmin(admin.ModelAdmin): - form = autocomplete_light.modelform_factory(ChoixSpectacle) + form = autocomplete_light.modelform_factory(ChoixSpectacle, exclude=[]) list_display = ("participant", "spectacle", "priority", "double", "autoquit") list_filter = ("double", "autoquit") search_fields = ('participant__user__username', 'participant__user__first_name', 'participant__user__last_name') diff --git a/gestioncof/admin.py b/gestioncof/admin.py index dd96b022..860f37a2 100644 --- a/gestioncof/admin.py +++ b/gestioncof/admin.py @@ -144,7 +144,7 @@ def user_unicode(self): return self.username User.__unicode__ = user_unicode class EventRegistrationAdmin(admin.ModelAdmin): - form = autocomplete_light.modelform_factory(EventRegistration) + form = autocomplete_light.modelform_factory(EventRegistration, exclude=[]) list_display = ('__unicode__','event','user','paid') list_filter = ('paid',) search_fields = ('user__username', 'user__first_name', 'user__last_name', 'user__email', 'event__title')