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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-no-lazy-queries-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbddf975fd5eab1db7e3b77ab3d7e1e2fd1e9a151630c94c6786231a2d654b72 |
|
MD5 | e9b67bc209843b3e19e7ab03578a9fdd |
|
BLAKE2b-256 | 1b4428d9c91d0feda1e3ac9566239f53ae41a0e41795b003815fd8b25143a990 |
Close
Hashes for django_no_lazy_queries-0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b432fd369262e1f03462b2f5da0004a6c2ba714b80cc58359463b48731197005 |
|
MD5 | c6b24671c575910790f6554d270245ef |
|
BLAKE2b-256 | 7828567be53141e878635f8f086f0014a4d3ea9dbdee697bca1b020265ab1b72 |