mirror of https://github.com/django/django.git
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:
parent
796cc62026
commit
a757c68129
|
@ -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):
|
||||||
|
|
|
@ -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):
|
||||||
|
|
|
@ -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')
|
||||||
|
|
Loading…
Reference in New Issue