Simple example of how to use a class based view and django-filter?

后端 未结 2 2031
迷失自我
迷失自我 2021-01-18 12:39

The example in the documentation, https://django-filter.readthedocs.org/en/latest/usage.html, is I think for a function based view. I am currently researching how to do th

2条回答
  •  不要未来只要你来
    2021-01-18 12:53

    As mentioned in the link Viewing subsets of objects

    You can use something like this is your views.py

    class modelListView(someGenericView):
            queryset = modelName.object.filter(myFilter)
    

提交回复
热议问题