﻿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
6575	Changeset 7098 brakes model class creation if one uses own django.db.model.base.Model class	moep	Malcolm Tredinnick	"Changeset 7098 brakes model class creation if one uses an own django.db.model.base.Model replacement class.

The problem is that `ModelBase.__new__` assumes that a class that is a subclass of Model automatically has a _meta attribute.
That is not necessarily the case. If you use a custom replacement for Model that extends Model it is a subclass of Model but 
doesn't have a meta attribute.

file mymodel.py
{{{
from django.db import modfrom django.db import models

class MyModelBase(models.base.ModelBase):
	pass

class MyModel(models.base.Model):
	pass

class Foo(MyModel):
	pass
}}}

{{{
$ import mymodel
>>> AttributeError: type object 'MyModel' has no attribute '_meta'
}}}

The problem is that you cannot so easily decide whether a class that extends Model is a Model Class or not. You could
of course check whether Class has a _meta attribute but that isn't a nice solution. 

I think the only clean way to test if a class that extends Model is actually a Model is to use a special class from which
you can derive. But that's is why Model exists in the first place (except for metaclassing) I think.

So we need a design decision here, whether we add a new class that extends and replaces models.Model, we add a ""ugly""
test if class has a _meta attribute or don't allow replacing model.Model at all.


 "		closed	Database layer (models, ORM)	dev		invalid			Unreviewed	0	0	0	0	0	0
