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.

Files for django-no-lazy-queries, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size django_no_lazy_queries-0.1-py2.py3-none-any.whl (3.2 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size django-no-lazy-queries-0.1.tar.gz (1.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page