﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
5817	Support inheritance for model option classes	miracle2k	nobody	"This currently is not possible:

{{{
class BaseMeta(object):
    app_label = ""myapp""

class Company(models.Model):
    class Meta(BaseMeta):
        pass
}}}

The reason is that db.models.options.Options.contribute_to_class() uses !__dict!__ to determine which attributes have been given. It attempts to delete from !__dict!__, which apparently is not allowed for new-style classes, but !__dict!__ will not include attributes of superclasses anyway.

I attached a simple patch that uses dir() instead - if been using it for a while and there don't seem to be any problems.

Note that the patch will *not* allow custom meta attributes by prefixing them with !__:

{{{metakritik.site: 'class Meta' got invalid attribute(s): _BaseMeta__myopt}}}"		closed	Core (Other)	dev		fixed	qs-rf-fixed		Fixed on a branch	1	0	0	0	0	0
