summaryrefslogtreecommitdiff
path: root/tests/admin_widgets/widgetadmin.py
diff options
context:
space:
mode:
authorJohannes Maron <info@johanneshoppe.com>2021-03-18 11:21:23 +0100
committerCarlton Gibson <carlton.gibson@noumenal.es>2021-03-18 14:21:12 +0100
commita8fef6daaf75cd24262d973b154fb6580efd99a4 (patch)
treee70b7be0a7e5fd69f2edef03787dab806c1bde4d /tests/admin_widgets/widgetadmin.py
parent6b020f3c94fb7f27875d5fe21a71a5ee7c9a7538 (diff)
[3.2.x] Fixed #32466 -- Corrected autocomplete to_field resolution for complex cases.
In MTI or ForeignKey as primary key cases, it is required to fetch the attname from the field instance on the remote model in order to reliably resolve the to_field_name. Backport of ceb4b9ee68dffc6ab0398886f1758f15f037c472 from main Backport of 03d0f12c823239812da21e5180aaa74dc6fd146e from main Co-authored-by: Johannes Maron <info@johanneshoppe.com> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
Diffstat (limited to 'tests/admin_widgets/widgetadmin.py')
-rw-r--r--tests/admin_widgets/widgetadmin.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/admin_widgets/widgetadmin.py b/tests/admin_widgets/widgetadmin.py
index a471a362fb..a025bc82a7 100644
--- a/tests/admin_widgets/widgetadmin.py
+++ b/tests/admin_widgets/widgetadmin.py
@@ -2,7 +2,7 @@ from django.contrib import admin
from .models import (
Advisor, Album, Band, Bee, Car, CarTire, Event, Inventory, Member, Profile,
- School, User,
+ ReleaseEvent, School, User, VideoStream,
)
@@ -47,6 +47,8 @@ site.register(Member)
site.register(Band)
site.register(Event, EventAdmin)
site.register(Album, AlbumAdmin)
+site.register(ReleaseEvent, search_fields=['name'])
+site.register(VideoStream, autocomplete_fields=['release_event'])
site.register(Inventory)