Skip to content
Snippets Groups Projects
Commit b8403ed3 authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

FEAT(export_sample_csv): Export sample names

parent 8045be1d
No related branches found
No related tags found
1 merge request!2F sample name
...@@ -335,6 +335,11 @@ def extract_event_url(record, key): ...@@ -335,6 +335,11 @@ def extract_event_url(record, key):
return None return None
def extract_sample_name(record, key):
return record.name
# must include all keys from SPECIAL_TREATMENT # must include all keys from SPECIAL_TREATMENT
EXTRACTORS = use_custom_names({ EXTRACTORS = use_custom_names({
"entity_id": lambda record, key: record.id, "entity_id": lambda record, key: record.id,
...@@ -356,6 +361,7 @@ EXTRACTORS = use_custom_names({ ...@@ -356,6 +361,7 @@ EXTRACTORS = use_custom_names({
"Longitude stop": extract_lng_stop, "Longitude stop": extract_lng_stop,
"PDFReport": extract_pdf_id, "PDFReport": extract_pdf_id,
"PI": extract_person, "PI": extract_person,
"sample_name": extract_sample_name,
"Sampling method": default_find, "Sampling method": default_find,
"Sphere": extract_sphere, "Sphere": extract_sphere,
"Start date": extract_start_date, "Start date": extract_start_date,
......
...@@ -25,6 +25,7 @@ csv_column_names: ...@@ -25,6 +25,7 @@ csv_column_names:
locality_name_prop: "Locality name" locality_name_prop: "Locality name"
responsible_person_event: "Event responsible" responsible_person_event: "Event responsible"
parent_sample_prop: "Parent LinkAhead ID" parent_sample_prop: "Parent LinkAhead ID"
sample_name: "Sample name"
csv_column_descriptions: csv_column_descriptions:
LinkAhead ID: "An ID generated by LinkAhead (either integer or URL to this entity). Do not change this column!" 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: ...@@ -52,6 +53,7 @@ csv_column_descriptions:
Timezone: "Timezone: Either UTC, CET, .... or in the form +hh[:mm], -hh:[mm]." 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 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" 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: entity_names:
abbreviation_prop: abbreviation abbreviation_prop: abbreviation
......
...@@ -79,7 +79,6 @@ DATATYPE_DEFINITIONS = use_custom_names({ ...@@ -79,7 +79,6 @@ DATATYPE_DEFINITIONS = use_custom_names({
# Must exist # Must exist
OBLIGATORY_COLUMNS = use_custom_names([ OBLIGATORY_COLUMNS = use_custom_names([
"entity_id", "entity_id",
"Start date",
]) ])
OBLIGATORY_COLUMNS_CHILD = use_custom_names([ OBLIGATORY_COLUMNS_CHILD = use_custom_names([
...@@ -118,6 +117,7 @@ SPECIAL_TREATMENT_SAMPLE = use_custom_names([ ...@@ -118,6 +117,7 @@ SPECIAL_TREATMENT_SAMPLE = use_custom_names([
"PI", "PI",
"PDFReport", "PDFReport",
"parent_sample_prop", "parent_sample_prop",
"sample_name",
"Sphere", "Sphere",
"Start date", "Start date",
"Storage ID", "Storage ID",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment