Opened 4 years ago

Closed 18 months ago

#20203 closed Bug (fixed)

Impossible to have a descriptor named `objects` on an abstract model

Reported by: Alex Gaynor Owned by: Andriy Sokolovskiy
Component: Database layer (models, ORM) Version: master
Severity: Normal Keywords:
Cc: me@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This is because of https://github.com/django/django/blob/master/django/db/models/manager.py#L17 , in general the ORM supports having a different name for the default manager, but this blows up with abstract models, which is sad.

Change History (8)

comment:1 Changed 4 years ago by Karol Sikora

Owner: changed from nobody to Karol Sikora
Status: newassigned

comment:2 Changed 4 years ago by Karol Sikora

Owner: Karol Sikora deleted
Status: assignednew

comment:3 Changed 18 months ago by Andriy Sokolovskiy

Cc: me@… added
Owner: set to Andriy Sokolovskiy
Status: newassigned
Version: 1.5master

I'm working on this issue

comment:4 Changed 18 months ago by Andriy Sokolovskiy

Has patch: set

comment:5 Changed 18 months ago by Tim Graham

Triage Stage: AcceptedReady for checkin

comment:6 Changed 18 months ago by Tim Graham <timograham@…>

In c0cf73a:

Refs #20203 -- Allowed adding custom default manager to the model state

If the only manager on the model is the default manager defined
by Django (objects = models.Manager()), this manager will not
be added to the model state. If it is custom, it needs to be
passed to the model state.

comment:7 Changed 18 months ago by Tim Graham <timograham@…>

In c31bf8c:

Refs #20203 -- Added tests to check inherited custom default manager

comment:8 Changed 18 months ago by Tim Graham

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.
Back to Top