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.
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>
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>
* 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>
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>
* 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>
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>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/28750#comment:7>
* 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>
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>
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>