kezabelle / django-shouty-orm

An in-progress monkeypatch to make Django error super loudly about ORM access which would normally silently cause additional queries
BSD 2-Clause "Simplified" License
7 stars 0 forks source link

Figure out an escape hatch? #2

Open kezabelle opened 4 years ago

kezabelle commented 4 years ago

Guarantee there's places where you can't fix the potential extra queries from being triggered. Probably in 3rd party apps, mostly. Or false-like positives where doing an extra query isn't the end of the world...

So wtf do I do in that scenario? For first-party code I could probably force an attribute onto the querysets/instances that get cloned:

x = MyModel.objects.all()
x._shouty_disabled = True
x.first().myrelation.pk

or something. But 3rd party code would still be ruined...