In django, set raw_id_fields field in admin, you can make selections and search through the pop-up page on the computer side, but on the mobile phone side, if you search or filter the pop-up page and request a new page, you will not be able to select the associated fields on the new page. It shows that the new page will not respond to the click
class Warehouse(models.Model): CK_CHOICES = ( ("A","warehouse1"), ("B","warehouse2"), ) category = models.CharField(default="A",choices=CK_CHOICES,max_length=2) name = models.CharField(default="",max_length=30) class Test(models.Model): name = models.ForeignKey(Warehouse, on_delete=models.CASCADE)
class WarehouseAdmin(admin.ModelAdmin): list_filter = ['category'] search_fields = ['name'] list_display = ['name'] class TestAdmin(admin.ModelAdmin): raw_id_fields = ["name"] list_display = ['name']
On mobile, when you are selecting the associated field of Warehouse, if you directly select the associated field after opening the field selection page, it is normal, but if you perform search and filter operations on the field selection page, it will lead to opening a new page after searching or filtering. In this page, the fields cannot be selected and there is no response when clicked.