'If this is the default base layer then remove this flag from all
others in this config.'

@staticmethod
def gis_layer_config_onaccept(form):

    form_vars = form.vars
    base = form_vars.base
    if (base == 'False'):
        base = False
    enabled = form_vars.enabled
    if (enabled == 'False'):
        enabled = False
    if (base and enabled):
        db = current.db
        ctable = db.gis_config
        ltable = db.gis_layer_config
        query = ((ltable.id == form_vars.id) & (ltable.config_id == ctable.id))
        config = db(query).select(ctable.id, limitby=(0, 1)).first()
        if config:
            query = (((ltable.config_id == config.id) & (ltable.base == True)) & (ltable.id != form_vars.id))
            db(query).update(base=False)
