def __settings_ShowHide(settings, key, active):
    settings = settings.values()

    show_settings = cfg.cfg_tableList(key)
    # There is a valid user settings, make dict
    if settings:
        # Take last
        settings = settings[0]
        s = settings.get(key, '')
        if s:
            show_settings = s.split('-')
        else:
            logger.error("No custom settings for %s, foldback on default.", key)
    else:
        logger.error("No custom settings for %s, foldback on default.", key)

    show = []
    for i in show_settings:
        show.append({'id':i, 'label': i.replace('_', ' ').capitalize()})

        hide = []
        for i in cfg.CFG_ALL:
            if i not in show_settings:
                hide.append({'id':i, 'label': i.replace('_', ' ').capitalize()})

    return {'setting_id':key, 'setting_label':cfg.cfg_tableLabel(key),
            'show':show, 'hide':hide, 'active':active}
def settings_columView(key):
    select = models.Settings.objects.all()
    l = cfg.cfg_tableList(key)
    if select:
        select = select.values()[0]
        ll = select[key].split('-')
        if ll[0]:
            l = ll
    return l