From b249d61c2d75cccbd1a0da24e8f371490e44a105 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Fri, 7 Oct 2016 23:49:55 +0200 Subject: [PATCH 1/2] fix recherche dans spectaclerevente --- bda/admin.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bda/admin.py b/bda/admin.py index 37fdf9c7..2991ebf5 100644 --- a/bda/admin.py +++ b/bda/admin.py @@ -219,8 +219,7 @@ class SpectacleReventeAdmin(admin.ModelAdmin): list_display = ("spectacle", "seller", "date", "soldTo") raw_id_fields = ("attribution",) readonly_fields = ("shotgun", "expiration_time") - search_fields = ("spectacle__title", - "seller__user__username", + search_fields = ("seller__user__username", "seller__user__firstname", "seller__user__lastname",) From 36cd6231055dfc6c494c30e3997079ad7df98abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Tue, 11 Oct 2016 14:59:30 +0200 Subject: [PATCH 2/2] Corrections des typos - Ligne vide - `lastname` -> `last_name` - `firstname` -> `first_name` - `spectacle__title` -> `attribution__spectacle__title` --- bda/admin.py | 7 ++++--- bda/models.py | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bda/admin.py b/bda/admin.py index 2991ebf5..e07a5d49 100644 --- a/bda/admin.py +++ b/bda/admin.py @@ -219,9 +219,10 @@ class SpectacleReventeAdmin(admin.ModelAdmin): list_display = ("spectacle", "seller", "date", "soldTo") raw_id_fields = ("attribution",) readonly_fields = ("shotgun", "expiration_time") - search_fields = ("seller__user__username", - "seller__user__firstname", - "seller__user__lastname",) + search_fields = ['attribution__spectacle__title', + 'seller__user__username', + 'seller__user__first_name', + 'seller__user__last_name'] admin.site.register(CategorieSpectacle) diff --git a/bda/models.py b/bda/models.py index 3642ee83..d61f6b9b 100644 --- a/bda/models.py +++ b/bda/models.py @@ -228,7 +228,6 @@ class SpectacleRevente(models.Model): answered_mail = models.ManyToManyField(Participant, related_name="wanted", blank=True) - seller = models.ForeignKey(Participant, related_name="original_shows", verbose_name="Vendeur")