def get_model_field(self, model, field):
        try:
            attr = getattr(model, field)
        except AttributeError:
            model_admin = self.admin[type(model)]
            try:
                attr = getattr(model_admin, field)
            except __HOLE__:
                raise AttributeError('Could not find attribute or method '
                                     'named "%s".' % field)
            else:
                return attr(model)
        else:
            if callable(attr):
                attr = attr()
            return attr
dataset/ETHPy150Open coleifer/flask-peewee/flask_peewee/admin.py/AdminTemplateHelper.get_model_field