#NEWLINE# def call_on_bases( cls , name , * args , **kw ) : #NEWLINE# #INDENT# "\n    Doesn't work. See `20110914`.\n    This is necessary because we want to call `setup_report`\n    on the model and all base classes of the model.\n    We cannot use super() for this because the `setup_report`\n    method is optional.\n    " #NEWLINE# for b in cls . __bases__ : #NEWLINE# #INDENT# call_on_bases ( b , name , * args , ** kw ) #NEWLINE# #UNINDENT# if True : #NEWLINE# #INDENT# m = getattr ( cls , name , None ) #NEWLINE# if ( ( m is not None ) and ( m . __self__ . __class__ is cls ) ) : #NEWLINE# #INDENT# m ( cls , * args , ** kw ) #NEWLINE# #UNINDENT# #UNINDENT# 'Note: the following algorithm worked in Python 2.7 but not in 2.6,\n    a classmethod object in 2.6 has no attribute `im_func`\n    '