'If we have a file, then set the URL to point to it'

@staticmethod
def gis_layer_kml_onaccept(form):

    id = form.vars.id
    table = current.s3db.gis_layer_kml
    record = current.db((table.id == id)).select(table.id, table.file, limitby=(0, 1)).first()
    if (record and record.file):
        record.update_record(url=URL(c='static', f='cache', args=['kml', record.file]), refresh=0)
    gis_layer_onaccept(form)
