Opened 5 months ago
Last modified 5 months ago
#35585 closed Bug
`Query.has_results` calls `.exists()` with wrong argument — at Version 1
Reported by: | Flavio Curella | Owned by: | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Flavio Curella | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
The has_results
method of the Query
class (in django/db/models/sql/query.py
), passes the using
argument to the exists()
method:
def has_results(self, using): q = self.exists(using) compiler = q.get_compiler(using=using) return compiler.has_results()
but the signature of the exists
method does not accept an argument to select the db connection. It only accepts an argument to limit the rows it should fetch:
def exists(self, limit=True): # ... snip ...
Note:
See TracTickets
for help on using tickets.