#24911: QuerySet is initiated with model=None as kwarg, but is called in
BaseManager.get_queryset() as arg.
----------------------------------------------+--------------------
Reporter: 317070 | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
----------------------------------------------+--------------------
QuerySet is initiated with model=None as named argument a.k.a. kwarg:
{{{
class QuerySet(object):
def __init__(self, model=None, query=None, using=None, hints=None):
}}}
But it is called in get_queryset as positional argument a.k.a. arg:
{{{
def get_queryset(self):
return self._queryset_class(self.model, using=self._db,
hints=self._hints)
}}}
This causes trouble when overriding get_queryset (which is the idea behind
the method) and using super(BlaBlaManager, self).get_queryset() which
returns a non-standard queryset-class, where model is not necessarily the
first argument, which should have been okay as model is a named argument.
Proposed solution:
in db/models/manager.py
{{{
def get_queryset(self):
return self._queryset_class(model=self.model, using=self._db,
hints=self._hints)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24911>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/049.d327ce19887b8129380011a9b3dafeac%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.