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'.
This commit is contained in:
Adam Chainz 2016-08-05 16:19:09 +01:00 committed by Tim Graham
parent 796cc62026
commit a757c68129
3 changed files with 4 additions and 4 deletions

View File

@ -344,7 +344,7 @@ class LanguageAdmin(admin.ModelAdmin):
class RecommendationAdmin(admin.ModelAdmin): class RecommendationAdmin(admin.ModelAdmin):
show_full_result_count = False show_full_result_count = False
search_fields = ('=titletranslation__text', '=recommender__titletranslation__text',) search_fields = ('=titletranslation__text', '=the_recommender__titletranslation__text',)
class WidgetInline(admin.StackedInline): class WidgetInline(admin.StackedInline):

View File

@ -397,7 +397,7 @@ class Recommender(Title):
class Recommendation(Title): class Recommendation(Title):
recommender = models.ForeignKey(Recommender, models.CASCADE) the_recommender = models.ForeignKey(Recommender, models.CASCADE)
class Collector(models.Model): class Collector(models.Model):

View File

@ -2957,9 +2957,9 @@ class AdminSearchTest(TestCase):
cls.per3 = Person.objects.create(name='Guido van Rossum', gender=1, alive=True) cls.per3 = Person.objects.create(name='Guido van Rossum', gender=1, alive=True)
cls.t1 = Recommender.objects.create() 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.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.tt1 = TitleTranslation.objects.create(title=cls.t1, text='Bar')
cls.tt2 = TitleTranslation.objects.create(title=cls.t2, text='Foo') cls.tt2 = TitleTranslation.objects.create(title=cls.t2, text='Foo')