[Django] #28750: Django 2.0 should permit Meta.manager_inheritance_from_future

15 views
Skip to first unread message

Django

unread,
Oct 28, 2017, 8:30:45 PM10/28/17
to django-...@googlegroups.com
#28750: Django 2.0 should permit Meta.manager_inheritance_from_future
-------------------------------------+-------------------------------------
Reporter: Charlie | Owner: nobody
Denton |
Type: Bug | Status: new
Component: Database | Version: 2.0
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I'm trying to make a library compatible with both django 1.11 and 2.0b1,
but I've hit something of a snag.

I have added `manager_inheritance_from_future` to the `Meta` class of my
base model, which removes the following warning:

RemovedInDjango20Warning: Managers from concrete parents will soon
qualify as default managers if they appear before any other managers in
the MRO. ...you can switch to the new behavior right away by setting
`Meta.manager_inheritance_from_future` to `True`.

So far so good,uUnfortunately, now that I've added that for django 1.11,
I'm getting this error on django 2.0b1:

TypeError: 'class Meta' got invalid attribute(s):
manager_inheritance_from_future

The `manager_inheritance_from_future` option was removed in
631f4ab06112aca5bd6a57b81159048f936050bf, but this is pretty frustrating.
I'm not sure how to make this library compatible with both versions, as a
result of this.

Perhaps this removal was premature?

--
Ticket URL: <https://code.djangoproject.com/ticket/28750>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 28, 2017, 8:31:19 PM10/28/17
to django-...@googlegroups.com
#28750: Django 2.0 should permit Meta.manager_inheritance_from_future
-------------------------------------+-------------------------------------
Reporter: Charlie Denton | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Charlie Denton:

Old description:

> I'm trying to make a library compatible with both django 1.11 and 2.0b1,
> but I've hit something of a snag.
>
> I have added `manager_inheritance_from_future` to the `Meta` class of my
> base model, which removes the following warning:
>
> RemovedInDjango20Warning: Managers from concrete parents will soon
> qualify as default managers if they appear before any other managers in
> the MRO. ...you can switch to the new behavior right away by setting
> `Meta.manager_inheritance_from_future` to `True`.
>
> So far so good,uUnfortunately, now that I've added that for django 1.11,
> I'm getting this error on django 2.0b1:
>
> TypeError: 'class Meta' got invalid attribute(s):
> manager_inheritance_from_future
>
> The `manager_inheritance_from_future` option was removed in
> 631f4ab06112aca5bd6a57b81159048f936050bf, but this is pretty frustrating.
> I'm not sure how to make this library compatible with both versions, as a
> result of this.
>
> Perhaps this removal was premature?

New description:

I'm trying to make a library compatible with both django 1.11 and 2.0b1,
but I've hit something of a snag.

I have added `manager_inheritance_from_future` to the `Meta` class of my
base model, which removes the following warning:

RemovedInDjango20Warning: Managers from concrete parents will soon
qualify as default managers if they appear before any other managers in
the MRO. ...you can switch to the new behavior right away by setting
`Meta.manager_inheritance_from_future` to `True`.

So far so good, unfortunately, now that I've added that for django 1.11,


I'm getting this error on django 2.0b1:

TypeError: 'class Meta' got invalid attribute(s):
manager_inheritance_from_future

The `manager_inheritance_from_future` option was removed in
631f4ab06112aca5bd6a57b81159048f936050bf, but this is pretty frustrating.
I'm not sure how to make this library compatible with both versions, as a
result of this.

Perhaps this removal was premature?

--

--
Ticket URL: <https://code.djangoproject.com/ticket/28750#comment:1>

Django

unread,
Oct 28, 2017, 8:31:57 PM10/28/17
to django-...@googlegroups.com
#28750: Django 2.0 should permit Meta.manager_inheritance_from_future
-------------------------------------+-------------------------------------
Reporter: Charlie Denton | Owner: nobody
Type: Bug | Status: new

Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Charlie Denton:

Old description:

> I'm trying to make a library compatible with both django 1.11 and 2.0b1,


> but I've hit something of a snag.
>
> I have added `manager_inheritance_from_future` to the `Meta` class of my
> base model, which removes the following warning:
>
> RemovedInDjango20Warning: Managers from concrete parents will soon
> qualify as default managers if they appear before any other managers in
> the MRO. ...you can switch to the new behavior right away by setting
> `Meta.manager_inheritance_from_future` to `True`.
>

> So far so good, unfortunately, now that I've added that for django 1.11,


> I'm getting this error on django 2.0b1:
>
> TypeError: 'class Meta' got invalid attribute(s):
> manager_inheritance_from_future
>
> The `manager_inheritance_from_future` option was removed in
> 631f4ab06112aca5bd6a57b81159048f936050bf, but this is pretty frustrating.
> I'm not sure how to make this library compatible with both versions, as a
> result of this.
>
> Perhaps this removal was premature?

New description:

I'm trying to make a library compatible with both django 1.11 and 2.0b1,
but I've hit something of a snag.

I have added `manager_inheritance_from_future` to the `Meta` class of my
base model, which removes the following warning:

RemovedInDjango20Warning: Managers from concrete parents will soon
qualify as default managers if they appear before any other managers in
the MRO. ...you can switch to the new behavior right away by setting
`Meta.manager_inheritance_from_future` to `True`.

So far so good. Unfortunately, now that I've added that for django 1.11,


I'm getting this error on django 2.0b1:

TypeError: 'class Meta' got invalid attribute(s):
manager_inheritance_from_future

The `manager_inheritance_from_future` option was removed in
631f4ab06112aca5bd6a57b81159048f936050bf, but this is pretty frustrating.
I'm not sure how to make this library compatible with both versions, as a
result of this.

Perhaps this removal was premature?

--

--
Ticket URL: <https://code.djangoproject.com/ticket/28750#comment:2>

Django

unread,
Oct 28, 2017, 8:37:11 PM10/28/17
to django-...@googlegroups.com
#28750: Django 2.0 should permit Meta.manager_inheritance_from_future
-------------------------------------+-------------------------------------
Reporter: Charlie Denton | Owner: nobody
Type: Bug | Status: new

Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* severity: Normal => Release blocker
* stage: Unreviewed => Accepted


Comment:

Sure, it would be fine to continue to allow it as a noop.

--
Ticket URL: <https://code.djangoproject.com/ticket/28750#comment:3>

Django

unread,
Oct 29, 2017, 1:43:53 AM10/29/17
to django-...@googlegroups.com
#28750: Django 2.0 should permit Meta.manager_inheritance_from_future
-------------------------------------+-------------------------------------
Reporter: Charlie Denton | Owner: nobody
Type: Bug | Status: new

Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Simon Charette):

FWIW you can branch off `django.VERSION` to prevent his error.

{{{#!python
import django

class MyModel(models.Model):
class Meta:
if django.VERSION < (2, 0):
manager_inheritance_from_future = True
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28750#comment:4>

Django

unread,
Oct 29, 2017, 5:34:38 AM10/29/17
to django-...@googlegroups.com
#28750: Django 2.0 should permit Meta.manager_inheritance_from_future
-------------------------------------+-------------------------------------
Reporter: Charlie Denton | Owner: Charlie
| Denton
Type: Bug | Status: assigned

Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Charlie Denton):

* owner: nobody => Charlie Denton
* status: new => assigned


Comment:

Thanks for the workaround, Simon! I feel daft for not thinking of it
myself. I'll blame the late hour, instead of my slow wits `;)`.

Also, thank you Tim for accepting the ticket. I'll try to add the flag as
a noop.

--
Ticket URL: <https://code.djangoproject.com/ticket/28750#comment:5>

Django

unread,
Oct 29, 2017, 9:19:06 AM10/29/17
to django-...@googlegroups.com
#28750: Django 2.0 should permit Meta.manager_inheritance_from_future
-------------------------------------+-------------------------------------
Reporter: Charlie Denton | Owner: Charlie
| Denton
Type: Bug | Status: assigned
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Charlie Denton):

FYI I've added a PR for this now:
https://github.com/django/django/pull/9306

--
Ticket URL: <https://code.djangoproject.com/ticket/28750#comment:6>

Django

unread,
Oct 29, 2017, 10:21:25 AM10/29/17
to django-...@googlegroups.com
#28750: Django 2.0 should permit Meta.manager_inheritance_from_future
-------------------------------------+-------------------------------------
Reporter: Charlie Denton | Owner: Charlie
| Denton
Type: Bug | Status: assigned
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Charlie Denton):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/28750#comment:7>

Django

unread,
Oct 31, 2017, 1:22:50 PM10/31/17
to django-...@googlegroups.com
#28750: Django 2.0 should permit Meta.manager_inheritance_from_future
-------------------------------------+-------------------------------------
Reporter: Charlie Denton | Owner: Charlie
| Denton
Type: Bug | Status: closed

Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"cbe334918a0a80762249706a15b699714b5dc828" cbe3349]:
{{{
#!CommitTicketReference repository=""
revision="cbe334918a0a80762249706a15b699714b5dc828"
Fixed #28750 -- Allowed models to define
Meta.manager_inheritance_from_future for backwards compatibility.

Refs 631f4ab06112aca5bd6a57b81159048f936050bf.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28750#comment:8>

Django

unread,
Oct 31, 2017, 10:22:15 PM10/31/17
to django-...@googlegroups.com
#28750: Django 2.0 should permit Meta.manager_inheritance_from_future
-------------------------------------+-------------------------------------
Reporter: Charlie Denton | Owner: Charlie
| Denton
Type: Bug | Status: closed
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"2e6dd975a228d8a590248da38a2b6f4e74876260" 2e6dd975]:
{{{
#!CommitTicketReference repository=""
revision="2e6dd975a228d8a590248da38a2b6f4e74876260"
[2.0.x] Fixed #28750 -- Allowed models to define
Meta.manager_inheritance_from_future for backwards compatibility.

Refs 631f4ab06112aca5bd6a57b81159048f936050bf.

Backport of cbe334918a0a80762249706a15b699714b5dc828 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28750#comment:9>

Django

unread,
Jan 17, 2019, 12:31:19 PM1/17/19
to django-...@googlegroups.com
#28750: Django 2.0 should permit Meta.manager_inheritance_from_future
-------------------------------------+-------------------------------------
Reporter: Charlie Denton | Owner: Charlie
| Denton
Type: Bug | Status: closed
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"da1de1615c4d498d7de015dc0028ad4be220df15" da1de161]:
{{{
#!CommitTicketReference repository=""
revision="da1de1615c4d498d7de015dc0028ad4be220df15"
Refs #28750 -- Removed suppport for model
Meta.manager_inheritance_from_future.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28750#comment:10>

Reply all
Reply to author
Forward
0 new messages