def datastore_fields(resource, valid_field_types):
 data = {'resource_id': resource['id'], 'limit': 0}
 fields = toolkit.get_action('datastore_search')({}, data)['fields']
 return [{'value': f['id'], 'text': f['id']} for f in fields if (f['type'] in valid_field_types)]

def datastore_fields ( resource , valid_field_types ) : data = { 'resource_id' : resource [ 'id' ] , 'limit' : 0 } fields = toolkit . get_action ( 'datastore_search' ) ( { } , data ) [ 'fields' ] return [ { 'value' : f [ 'id' ] , 'text' : f [ 'id' ] } for f in fields if ( f [ 'type' ] in valid_field_types ) ]
return a list of all datastore fields for a given resource .