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.

猜你喜欢

转载自www.cnblogs.com/shengulong/p/10111280.html