Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dabapps/django-readers-debug
A pretty-printer for debugging django-readers queryset functions
https://github.com/dabapps/django-readers-debug
Last synced: 4 days ago
JSON representation
A pretty-printer for debugging django-readers queryset functions
- Host: GitHub
- URL: https://github.com/dabapps/django-readers-debug
- Owner: dabapps
- License: bsd-2-clause
- Created: 2021-04-20T09:50:43.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-17T14:07:13.000Z (over 1 year ago)
- Last Synced: 2024-12-11T20:48:52.833Z (15 days ago)
- Language: Python
- Size: 23.4 KB
- Stars: 5
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
django-readers-debug
====================**STATUS: EXPERIMENTAL**
**A pretty-printer for debugging [django-readers](https://github.com/dabapps/django-readers) queryset functions.**
### Installation
Install from PyPI
pip install django-readers-debug
## Usage
Without `django-readers-debug`:
```pycon
>>> 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)
.piped at 0x10ce2a670>
>>>
```With `django-readers-debug`:
```pycon
>>> 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/](https://www.dabapps.com/open-source/code-of-conduct/)