﻿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
2363	[patch] Tighten subclass check at top of db.models.base.ModelBase.__new__.	phil.h.smith@…	Malcolm Tredinnick	"The ""not bases or bases == (object,)"" check at the top of ModelBase.__new__ assumes that if the class-to-be has any bases, that one of them will be Model.

It cropped up while writing a mixin superclass for models that provided some new service-ish functionality for my app.  The mixin requires a metaclass of its own.  To satisfy guido's metaclass resolution rules, my mixin's metaclass extends ModelBase.  The catch: when evaluating my mixin definition, ModelBase is invoked.  My mixin has a superclass, so it slips past the check, and things explode.

My own metaclass can opt to check the Model subclass condition itself, and not call super(..).__new__, but that is hackish.  Please consider the attached patch instead.

Thanks for listening!"	enhancement	closed	Core (Other)		normal	fixed			Ready for checkin	1	0	0	0	0	0
