'If the Comments are a Style then create a gis_style record for this
and blank the comment. Used for s3csv imports as we have no components & can\'t use an import_prep as we don\'t know the record_id'

@staticmethod
def gis_poi_onaccept(form):

    form_vars = form.vars
    comments = form_vars.get('comments')
    if (not comments):
        return
    value = comments.replace("'", '"')
    try:
        style = json.loads(value)
    except:
        return
    db = current.db
    s3db = current.s3db
    table = s3db.gis_poi_type
    poi_type = db((table.id == form_vars.poi_type_id)).select(table.name, limitby=(0, 1)).first()
    try:
        poi_type = poi_type.name
    except:
        return
    table = s3db.gis_layer_feature
    query = (((table.controller == 'gis') & (table.function == 'poi')) & ((table.filter == None) | (table.filter == ('poi_type.name__typeof=%s' % poi_type))))
    postgres = (current.deployment_settings.get_database_type() == 'postgres')
    if postgres:
        orderby = table.filter
    else:
        orderby = (~ table.filter)
    layer = db(query).select(table.layer_id, table.filter, limitby=(0, 1), orderby=orderby).first()
    try:
        layer_id = layer.layer_id
    except:
        current.log.warning("Couldn't    find    a    layer    to    use    for    this    PoI    Style")
        return
    record_id = form_vars.id
    table = s3db.gis_style
    table.insert(layer_id=layer_id, record_id=record_id, style=style)
    db((db.gis_poi.id == record_id)).update(comments=None)
