mirror of
https://github.com/django/django.git
synced 2025-11-20 03:30:00 +00:00
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. 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>
This commit is contained in:
parent
0b120f5d64
commit
03d0f12c82
8 changed files with 153 additions and 8 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue