@core_helper
def resource_view_get_fields(resource):
 if (not resource.get('datastore_active')):
  return []
 data = {'resource_id': resource['id'], 'limit': 0}
 result = logic.get_action('datastore_search')({}, data)
 fields = [field['id'] for field in result.get('fields', [])]
 return sorted(fields)

@ core_helper def resource_view_get_fields ( resource ) : if ( not resource . get ( 'datastore_active' ) ) : return [ ] data = { 'resource_id' : resource [ 'id' ] , 'limit' : 0 } result = logic . get_action ( 'datastore_search' ) ( { } , data ) fields = [ field [ 'id' ] for field in result . get ( 'fields' , [ ] ) ] return sorted ( fields )
returns sorted list of text and time fields of a datastore resource .