From a757c68129fe5b416c6a71a5401f90e3208bae99 Mon Sep 17 00:00:00 2001 From: Adam Chainz Date: Fri, 5 Aug 2016 16:19:09 +0100 Subject: [PATCH] Fixed admin_views clashing field check error. admin_views.Recommendation.recommender: (models.E006) The field 'recommender' clashes with the field 'recommender' from model 'admin_views.title'. --- tests/admin_views/admin.py | 2 +- tests/admin_views/models.py | 2 +- tests/admin_views/tests.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/admin_views/admin.py b/tests/admin_views/admin.py index a987e146dc..81971c9043 100644 --- a/tests/admin_views/admin.py +++ b/tests/admin_views/admin.py @@ -344,7 +344,7 @@ class LanguageAdmin(admin.ModelAdmin): class RecommendationAdmin(admin.ModelAdmin): show_full_result_count = False - search_fields = ('=titletranslation__text', '=recommender__titletranslation__text',) + search_fields = ('=titletranslation__text', '=the_recommender__titletranslation__text',) class WidgetInline(admin.StackedInline): diff --git a/tests/admin_views/models.py b/tests/admin_views/models.py index b6ec1b6c31..8828c8b4da 100644 --- a/tests/admin_views/models.py +++ b/tests/admin_views/models.py @@ -397,7 +397,7 @@ class Recommender(Title): class Recommendation(Title): - recommender = models.ForeignKey(Recommender, models.CASCADE) + the_recommender = models.ForeignKey(Recommender, models.CASCADE) class Collector(models.Model): diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 8f12fcd068..b37535d5c8 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -2957,9 +2957,9 @@ class AdminSearchTest(TestCase): cls.per3 = Person.objects.create(name='Guido van Rossum', gender=1, alive=True) cls.t1 = Recommender.objects.create() - cls.t2 = Recommendation.objects.create(recommender=cls.t1) + cls.t2 = Recommendation.objects.create(the_recommender=cls.t1) cls.t3 = Recommender.objects.create() - cls.t4 = Recommendation.objects.create(recommender=cls.t3) + cls.t4 = Recommendation.objects.create(the_recommender=cls.t3) cls.tt1 = TitleTranslation.objects.create(title=cls.t1, text='Bar') cls.tt2 = TitleTranslation.objects.create(title=cls.t2, text='Foo')