Skip to main content

Prevent Django from automatically loading related models

Project description

A decorator to help remind you to use select_related.

Only use this while in development. Leaving it in production is a bad idea.

from nolazyqueries import no_lazy_queries

@no_lazy_queries()
def some_view(request):

    # Will raise an exception
    Foo.objects.first().bar

    # Will not raise an exception
    Foo.objects.select_related('bar').first().bar

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

django-no-lazy-queries-0.1.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

django_no_lazy_queries-0.1-py2.py3-none-any.whl (3.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-no-lazy-queries-0.1.tar.gz.

File metadata

File hashes

Hashes for django-no-lazy-queries-0.1.tar.gz
Algorithm Hash digest
SHA256 bbddf975fd5eab1db7e3b77ab3d7e1e2fd1e9a151630c94c6786231a2d654b72
MD5 e9b67bc209843b3e19e7ab03578a9fdd
BLAKE2b-256 1b4428d9c91d0feda1e3ac9566239f53ae41a0e41795b003815fd8b25143a990

See more details on using hashes here.

File details

Details for the file django_no_lazy_queries-0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_no_lazy_queries-0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b432fd369262e1f03462b2f5da0004a6c2ba714b80cc58359463b48731197005
MD5 c6b24671c575910790f6554d270245ef
BLAKE2b-256 7828567be53141e878635f8f086f0014a4d3ea9dbdee697bca1b020265ab1b72

See more details on using hashes here.

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