diff --git a/sample-management-custom/caosdb-server/scripting/bin/export_sample_csv.py b/sample-management-custom/caosdb-server/scripting/bin/export_sample_csv.py index 085c8398fbea5b4fa5ce12a5625b7ea8d0c24e29..885fb55f8285b355aac11befdcc68f1b2cf91b9a 100755 --- a/sample-management-custom/caosdb-server/scripting/bin/export_sample_csv.py +++ b/sample-management-custom/caosdb-server/scripting/bin/export_sample_csv.py @@ -335,6 +335,11 @@ def extract_event_url(record, key): return None +def extract_sample_name(record, key): + + return record.name + + # must include all keys from SPECIAL_TREATMENT EXTRACTORS = use_custom_names({ "entity_id": lambda record, key: record.id, @@ -356,6 +361,7 @@ EXTRACTORS = use_custom_names({ "Longitude stop": extract_lng_stop, "PDFReport": extract_pdf_id, "PI": extract_person, + "sample_name": extract_sample_name, "Sampling method": default_find, "Sphere": extract_sphere, "Start date": extract_start_date, diff --git a/sample-management-custom/caosdb-server/scripting/bin/sample_helpers/default_constants.yml b/sample-management-custom/caosdb-server/scripting/bin/sample_helpers/default_constants.yml index c575cb61f4cbd50676d8b944f7af7631963907bf..136d9ee2ebc26c81d0abf955890988892d7fef44 100644 --- a/sample-management-custom/caosdb-server/scripting/bin/sample_helpers/default_constants.yml +++ b/sample-management-custom/caosdb-server/scripting/bin/sample_helpers/default_constants.yml @@ -25,6 +25,7 @@ csv_column_names: locality_name_prop: "Locality name" responsible_person_event: "Event responsible" parent_sample_prop: "Parent LinkAhead ID" + sample_name: "Sample name" csv_column_descriptions: LinkAhead ID: "An ID generated by LinkAhead (either integer or URL to this entity). Do not change this column!" @@ -52,6 +53,7 @@ csv_column_descriptions: Timezone: "Timezone: Either UTC, CET, .... or in the form +hh[:mm], -hh:[mm]." Water depth start: "The bottom depth in meters where the sampling started as a positive value" Water depth stop: "The bottom depth in meters where the sampling ended as a positive value" + Sample name: "Name which will be given to the sample entity" entity_names: abbreviation_prop: abbreviation diff --git a/sample-management-custom/caosdb-server/scripting/bin/sample_helpers/sample_upload_column_definitions.py b/sample-management-custom/caosdb-server/scripting/bin/sample_helpers/sample_upload_column_definitions.py index 058452266722257db5023f076031d2cc570a54dd..1ad1ade25e314967d38fb53faf36a781f7ff6993 100644 --- a/sample-management-custom/caosdb-server/scripting/bin/sample_helpers/sample_upload_column_definitions.py +++ b/sample-management-custom/caosdb-server/scripting/bin/sample_helpers/sample_upload_column_definitions.py @@ -79,7 +79,6 @@ DATATYPE_DEFINITIONS = use_custom_names({ # Must exist OBLIGATORY_COLUMNS = use_custom_names([ "entity_id", - "Start date", ]) OBLIGATORY_COLUMNS_CHILD = use_custom_names([ @@ -118,6 +117,7 @@ SPECIAL_TREATMENT_SAMPLE = use_custom_names([ "PI", "PDFReport", "parent_sample_prop", + "sample_name", "Sphere", "Start date", "Storage ID",