Opened 8 years ago

Closed 8 years ago

#21390 closed Bug (invalid)

Custom Manager Documentation Error

Reported by: m0nonoke Owned by: nobody
Component: Documentation Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no


The documentation for trunk has a section on modifying initial querysets for custom managers here;

The code snippets and commentary as describe the hook as follows

class DahlBookManager(models.Manager):
    def get_queryset(self):
        return super(DahlBookManager, self).get_queryset().filter(author='Roald Dahl')

However this should be

class DahlBookManager(models.Manager):
    def get_query_set(self):
        return super(DahlBookManager, self).get_query_set().filter(author='Roald Dahl')

NB the get_query_set extra underscore

Change History (1)

comment:1 Changed 8 years ago by Baptiste Mispelon

Resolution: invalid
Status: newclosed


This is a new feature of django 1.6:

The various get_query_set methods have been renamed to get_queryset for consistency.

Note: See TracTickets for help on using tickets.
Back to Top