django-auto-related:自动为django-rest序列化程序正确使用django的select_related和prefetch_related方法

时间:2021-02-28 04:23:36
【文件属性】:
文件名称:django-auto-related:自动为django-rest序列化程序正确使用django的select_related和prefetch_related方法
文件大小:106KB
文件格式:ZIP
更新时间:2021-02-28 04:23:36
django serializer optimization django-rest-framework prefetch 自动相关 AutoRelated软件包会自动为django-rest序列化程序正确使用django的select_related select_related() , prefetch_related()和only()方法。 将序列化器传递给Tracer对象 使用返回的参数构建查询 您的查询已优化 要求 AutoRelated被开发并经过测试; Django版本:3.0、3.0.5 Django REST框架版本:3.10.3,3.11.0 Python版本:3.6、3.7、3.8 它只需要: Django的 Django REST框架 除上述以外的开发: Django调试工具栏 安装 要安装它,请使用 $ pip install auto-related 用法 如果您在serializers.py文件中定义了这样的序列化程序; from restframework imp
【文件预览】:
django-auto-related-master
----auto_related()
--------tracer.py(7KB)
--------method_field.py(389B)
--------utils.py(4KB)
--------__init__.py(0B)
--------mixin.py(1KB)
----LICENSE(1KB)
----setup.py(1KB)
----README.md(7KB)
----tests()
--------django_test()
----.gitignore(2KB)

网友评论