﻿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
13460	django.db.models.Model breaks multiple inheritance	Art	nobody	"django.db.models.Model breaks multiple inheritance by not calling 

super(...).__init__(...)

Here's example code:


{{{
from django.db import models

class A(models.Model):
    def __init__(self, *args, **kwargs):
        super(A, self).__init__(*args, **kwargs)
        print 'A'

    m = models.CharField()

class B(object):
    def __init__(self, *args, **kwargs):
        super(B, self).__init__(*args, **kwargs)
        print 'B'

class C(object):
    def __init__(self, *args, **kwargs):
        super(C, self).__init__(*args, **kwargs)
        print 'C'

class D(A, B, C):
    def __init__(self, *args, **kwargs):
        super(D, self).__init__(*args, **kwargs)
        print 'D'

D()
}}}

Resulting in: 

{{{
A
D
}}}


However as soon as I remove models.Model from parent for A and replace it with 'object', all the constructors are getting called and the output is:


{{{
C
B
A
D
}}}


Apparently this happens because MRO is nto beign composed properly when you ommit calls to parent's __init__, even if it's the object.
See http://fuhm.net/super-harmful/ for more details."		closed	Core (Other)	1.1		duplicate	inheritance		Unreviewed	0	0	0	0	0	0
