1. 程式人生 > >django的過濾和搜尋排序功能django-filter

django的過濾和搜尋排序功能django-filter

參考:

1、https://django-filter.readthedocs.io/en/master/guide/usage.html#the-filter

2、https://www.cnblogs.com/neozheng/p/9838440.html

3、https://zhuanlan.zhihu.com/p/47836057

4、https://www.jianshu.com/p/f3606a5def69

效果見swagger文件,api文件未配置成功

 

使用的外掛版本

# 20181207最新版本
# todo? 這個ide提示錯誤不知道如何規避,必須是==
django==2.1.4
ipython
==7.2.0 mysqlclient==1.3.14 django-rest-swagger==2.2.0 kafka-python==1.4.4 djangorestframework==3.9.0 djangorestframework-filters==0.10.2.post0 # 增強restful的過濾功能 django-filter==2.0.0 # 增加api文件的過濾功能,在swagger的文件裡能看到效果:https://django-filter.readthedocs.io/en/master/guide/rest_framework.html #django-crispy-forms==1.7
.2 # 優化前端顯示:https://django-crispy-forms.readthedocs.io/en/latest/install.html#installing-django-crispy-forms #django-filters==0.2.1 # 不知道和django-filter有什麼區別 # todo 怎麼用? #markdown==3.0.1 # Markdown support for the browsable API.