Django Xadmin Foreign key Association UserProfile (AbstractUser) model does not display drop-down list in the background

the user field of one of the app is the foreign key of UserProfile (AbstractUser). After registration in admin, it does not display a drop-down list, but a search box. The result I want is a drop-down list

it has been tested that associations can be displayed after registration of normal model classes, but not in models where one-to-many associations inherit from AbstractUser.

related code (app has been added to setting.py and the original user model of admin-AUTH_USER_MODEL = "user.UserProfile") has been overwritten

   

figure: what I want is that the user name also displays a drop-down list as above or below, showing the associated user information, rather than the input search box. (it is clear that the inverted triangle is displayed on the right, but the click only flashes for a moment, and there is no response. )

Apr.06,2022

has been solved. Xadmin/plugs/auth.py finds the UserAdmin class, then removes relfield_style = 'fk-ajax', removes search_filed
, and then adds relfield_style =' fk-ajax'


to the class corresponding to the adminx.py associated with the foreign key.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3967b-2c195.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3967b-2c195.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?