def attname_of(model, col, cache={}):
    if model not in cache:
        cache[model] = {f.db_column: f.attname for f in model._meta.fields}
    return cache[model].get(col, col)
dataset/ETHPy150Open Suor/django-cacheops/cacheops/tree.py/attname_of/original