我想使用django_filter,但我的数据类型是list。它显示列表没有属性模型
myfiler1 = Orderfilter(request.GET, queryset=mylist)
如何将列表转换为django.db.models.query.QuerySet
django.db.models.query.QuerySet
ojsjcaue1#
您需要通过**orderdata = myfiler1.qs**
orderdata = myfiler1.qs
orderdata = OrdersModel.objects.filter(user=request.user) myfiler1 = Orderfilter(request.GET, queryset=orderdata) orderdata = myfiler1.qs
1条答案
按热度按时间ojsjcaue1#
您需要通过**
orderdata = myfiler1.qs
**