I wasn't aware of this new feature Shai, thanks for pointing it out!

For this particular case I'd prefer locking to be bound to a particular 
queryset rather than the database as a whole. I would also expect it to 
fail loudly when accessing a non-fetched related object (book.author), 
which can be a common cause of pain.

I'm also still very interested in auto-prefetch Adam, is there any help I 
can lend?

On Thursday, 4 January 2018 17:32:19 UTC+11, Shai Berger wrote:
>
> Hi all, 
>
> Django 2.0 has a new feature[1] which allows you to say "I expect no 
> actual 
> database queries in this piece of code". It is not designed to stop a 
> specific 
> queryset from spawning requests, so getting it to do exactly what's asked 
> for 
> in this thread may be a little involved, but if your goal is to prevent 
> surprise queries, I think it is actually better than sealing a single 
> queryset. 
>
> HTH, 
>         Shai 
>
> [1] https://docs.djangoproject.com/en/2.0/topics/db/instrumentation/ 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/7441a83e-e459-4612-8dd7-cff48f5af7f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Sea... 'Bryan Helmig' via Django developers (Contributions to Django itself)
    • ... Tobias McNulty
    • ... charettes
      • ... Andres Osinski
        • ... Shai Berger
          • ... Adam Johnson
            • ... charettes
          • ... Josh Smeaton
            • ... Gordon Wrigley

Reply via email to