def get_fields_with_model(model, meta):
    try:
        return [
            (f, f.model if f.model != model else None)
            for f in meta.get_fields()
            if not f.is_relation
                or f.one_to_one
                or (f.many_to_one and f.related_model)
        ]
    except __HOLE__:
        return meta.get_fields_with_model()
dataset/ETHPy150Open django-denorm/django-denorm/denorm/db/base.py/get_fields_with_model