Skip to main content

A pretty-printer for debugging django-readers queryset functions

Project description

django-readers-debug

STATUS: EXPERIMENTAL

A pretty-printer for debugging django-readers queryset functions.

Installation

Install from PyPI

pip install django-readers-debug

Usage

Without 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>
>>>

With 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),
)

Known limitations

Best-effort printing of Q objects and Prefetch objects only.

Code of conduct

For guidelines regarding the code of conduct when contributing to this repository please review https://www.dabapps.com/open-source/code-of-conduct/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-readers-debug-0.0.3.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

django_readers_debug-0.0.3-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page