Changes between Initial Version and Version 1 of Ticket #24911


Ignore:
Timestamp:
Jun 3, 2015, 6:17:24 PM (9 years ago)
Author:
Jonas Degrave
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24911 – Description

    initial v1  
    1 QuerySet is initiated with model=None as named argument a.k.a. kwarg:
     1QuerySet is initiated with {{{model=None}}} as named argument a.k.a. kwarg:
    22{{{
    33class QuerySet(object):
    44     def __init__(self, model=None, query=None, using=None, hints=None):
    55}}}
    6 But it is called in get_queryset as positional argument a.k.a. arg:
     6But it is called in {{{get_queryset()}}} as positional argument a.k.a. arg:
    77{{{
    88def get_queryset(self):
    99        return self._queryset_class(self.model, using=self._db, hints=self._hints)
    1010}}}
    11 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.
     11This 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.
    1212
    1313Proposed solution:
     
    1717        return self._queryset_class(model=self.model, using=self._db, hints=self._hints)
    1818}}}
     19
     20Github pull request: https://github.com/django/django/pull/4745
Back to Top