Re: Sealing or locking QuerySets -- a suggestion to prevent surprise N+1 queries.

2018-01-03 Thread Shai Berger
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

Re: Sealing or locking QuerySets -- a suggestion to prevent surprise N+1 queries.

2018-01-03 Thread Andres Osinski
I'm very interested in this feature and would love to assist in making it happen. On Thu, Jan 4, 2018 at 12:34 AM, charettes wrote: > Hey everyone, > > I also believe this is a feature that should be in core > judging by the number of times I had to enable query logging >

Re: Sealing or locking QuerySets -- a suggestion to prevent surprise N+1 queries.

2018-01-03 Thread charettes
Hey everyone, I also believe this is a feature that should be in core judging by the number of times I had to enable query logging in the past or rely on assertNumQueries to make sure no extra queries would be inadvertently introduced in a critical code path. In the light of Anssi's comments on

Re: Sealing or locking QuerySets -- a suggestion to prevent surprise N+1 queries.

2018-01-03 Thread Tobias McNulty
1. I also could not find anything other than #26481 and a brief discussion of it on the list. 2. I've often wished for something like this, but ended up resorting to assertNumQueries() for lack of a better solution. So

Sealing or locking QuerySets -- a suggestion to prevent surprise N+1 queries.

2018-01-03 Thread 'Bryan Helmig' via Django developers (Contributions to Django itself)
At Zapier we're working with some rather complex and performance sensitive QuerySet building (most currently around experimenting with GraphQL) and I am constantly worried that the laziness of the ORM will surprise us in production (after a few levels of related nesting, the math of a mistake

Re: Get all the models referring to object

2018-01-03 Thread Tim Graham
This mailing list is for the development of Django itself, not for support. Use the django-users mailing list for that, or IRC #django on freenode, or a site like Stack Overflow. On Wednesday, January 3, 2018 at 12:12:31 PM UTC-5, mohitdu...@gmail.com wrote: > > How can i get all the Models

Get all the models referring to object

2018-01-03 Thread mohitdubey2695
How can i get all the Models referring to the field as foreign key. -- 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

Database session deletion

2018-01-03 Thread George-Cristian Bîrzan
The documentation explicitly mentions that expired sessions aren't automatically deleted from the database, except when the user manually logs out. [1] That, however, isn't the case. Firstly, when trying to access a user whose password was changed, the session is deleted from the database. [2]