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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 2 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