Troubleshooting “Related Field has invalid lookup: icontains”

后端 未结 8 871
萌比男神i
萌比男神i 2021-01-31 06:33

I have the following models in models.py:

class ListinoTraduttore(models.Model):
        traduttore = models.ForeignKey(\'Traduttore\', related_name=         


        
8条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-31 07:19

    Double underscore needed

    class exampleAdmin(admin.ModelAdmin):
     search_field = ('yourforeignkeyname__choosefieldnameinyourforeignkey')
    

提交回复
热议问题