﻿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
19688	It's not possible to use `six.with_metaclass` to subclass `models.Model` with a custom metaclass.	Simon Charette	Simon Charette	"A couple of django apps [https://github.com/search?q=base.ModelBase&type=Code&ref=searchresults in] [https://github.com/chrisglass/django_polymorphic/blob/master/polymorphic/base.py#L23 the] [https://github.com/mirumee/django-transmeta/blob/master/transmeta/__init__.py#L89 wild] subclass `models.base.BaseModel` in order to provide some extra functionality.

If those apps are ever ported to support PY2 and PY3 in the same code base using six they will have to use `six.with_metaclass` to achieve it.

Unfortunately, `models.base.BaseModel.__new__` chokes when a model is defined this way:
{{{
#!python
from django.db import models
from django.utils import six

class CustomBaseModel(models.base.BaseModel):
    pass

class CustomModel(six.with_metaclass(CustomBaseModel, models.Model)):
    pass
}}}

because the `'NewBase`' checks don't take into account this case."	Bug	closed	Python 3	dev	Normal	fixed			Accepted	1	0	0	0	0	0
