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):
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,
......
......@@ -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
......
......@@ -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",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment