我正在尝试使"vanKit“字段在我的管理页面中可搜索。"vanKit“是一个ForeignKey,每当我把它添加到我的search_fields列表中时,它就会给我这个错误:"Related Field got lookup:图标”。下面是我的代码: Models.py class KitSupplies(models.Model): sear
我知道在搜索时不能直接在外键上使用图标,但我还没有找到解决方案。下面是我在views.py中的搜索视图(我已经导入了所需的所有模型): # if the user actually fills up the formsearched, 'posts': posts}) return render(request, 'blog/search.html', {})
下面是我在model.py中的</em
我正在尝试使用呈现一个数据表,但是当我试图搜索时,django.core.exceptions.FieldError: Related Field got invalid lookup: istartswith我使用的模型有一个ForeignKey到另一个模型。我已经尝试了我找到的所有解决方案。他们不工作!!