def enable_layer(r, **attr):
 if (r.component_name != 'layer_entity'):
  session.error = T('Incorrect parameters')
  redirect(URL(args=[r.id, 'layer_entity']))
 ltable = s3db.gis_layer_config
 query = ((ltable.config_id == r.id) & (ltable.layer_id == r.component_id))
 db(query).update(enabled=True)
 session.confirmation = T('Layer has been Enabled')
 redirect(URL(args=[r.id, 'layer_entity']))

def enable_layer ( r , ** attr ) : if ( r . component_name != 'layer_entity' ) : session . error = T ( 'Incorrect parameters' ) redirect ( URL ( args = [ r . id , 'layer_entity' ] ) ) ltable = s3db . gis_layer_config query = ( ( ltable . config_id == r . id ) & ( ltable . layer_id == r . component_id ) ) db ( query ) . update ( enabled = True ) session . confirmation = T ( 'Layer has been Enabled' ) redirect ( URL ( args = [ r . id , 'layer_entity' ] ) )
enable a layer designed to be a custom method called by an action button @todo: make this call an api function which can then also be used by cli scripts .