用于调试django-readers查询集函数的格式化打印器
项目描述
django-readers-debug
状态:实验性
用于调试django-readers查询集函数的格式化打印器。
安装
从PyPI安装
pip install django-readers-debug
用法
没有django-readers-debug
>>> from django_readers import qs
>>> prepare = qs.pipe(
... qs.include_fields("name"),
... qs.auto_prefetch_relationship("author", qs.include_fields("name")),
... qs.filter(publication_year__gte=2021),
... )
>>> print(prepare)
<function pipe.<locals>.piped at 0x10ce2a670>
>>>
有django-readers-debug
>>> from django_readers_debug import debug_print
>>> debug_print(prepare)
qs.pipe(
qs.include_fields("name"),
qs.auto_prefetch_relationship(
"author", prepare_related_queryset=qs.include_fields("name")
),
qs.filter(publication_year__gte=2021),
)
已知限制
仅尽可能打印Q
对象和Prefetch
对象。
行为准则
有关贡献此存储库时的行为准则指南,请参阅https://www.dabapps.com/open-source/code-of-conduct/