#29386: Meta Inheritance for default_permissions
-------------------------------------+-------------------------------------
Reporter: Clayton Daley | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.11
(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
-------------------------------------+-------------------------------------
Changes (by Clayton Daley):
* status: closed => new
* resolution: invalid =>
Comment:
The section you cited says "child class to inherit from its parent’s Meta
class" which I interpret as the following:
{{{
class Parent(models.Model):
class Meta:
<stuff here>
class Child(Parent):
# no explicit meta definition
}}}
In my case, the Meta class is explicitly a subclass of the parent's Meta:
{{{
class Encounter(AbstractParentModel):
class Meta(BreadMetaMixin, AbstractParentModel.Meta):
pass
class Admission(Encounter):
class Meta(Encounter.Meta): # EXPLICIT inheritance
pass
}}}
So this should be covered by the Meta Inheritance documentation
([https://docs.djangoproject.com/en/2.0/topics/db/models/#meta-
inheritance]). This section specifically says:
> If the child wants to extend the parent’s Meta class, it can subclass
it... Django does make one adjustment to the Meta class of an abstract
base class: before installing the Meta attribute, it sets abstract=False.
It seems to me that it's also ignoring `default_permissions`. At minimum,
this is a documentation issue.
--
Ticket URL: <https://code.djangoproject.com/ticket/29386#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/070.832128351ec64ba4a1a289b05cccf54c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.