def base_concrete_model(abstract, model):
 if hasattr(model, u'objects'):
  return (model if model._meta.abstract else _base_concrete_model(abstract, model))
 return (_base_concrete_model(abstract, model.__class__) or model.__class__)

def base_concrete_model ( abstract , model ) : if hasattr ( model , u'objects' ) : return ( model if model . _meta . abstract else _base_concrete_model ( abstract , model ) ) return ( _base_concrete_model ( abstract , model . __class__ ) or model . __class__ )
used in methods of abstract models to find the super-most concrete model in the inheritance chain that inherits from the given abstract model .