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

ENH: Make column descriptions configurable

parent 3d61f99f
No related branches found
No related tags found
1 merge request!1F awi sams
...@@ -32,6 +32,8 @@ from caosadvancedtools.serverside.helper import send_mail ...@@ -32,6 +32,8 @@ from caosadvancedtools.serverside.helper import send_mail
from caoscrawler.config import get_config_setting from caoscrawler.config import get_config_setting
from linkahead import get_entity_by_name from linkahead import get_entity_by_name
from sample_helpers.utils import CONSTANTS
SPECIAL_TREATMENT_SAMPLE = [ SPECIAL_TREATMENT_SAMPLE = [
"BIS ID", "BIS ID",
"Collection", "Collection",
...@@ -82,34 +84,7 @@ IGNORED_COLUMN_NAMES_SAMPLE = [ ...@@ -82,34 +84,7 @@ IGNORED_COLUMN_NAMES_SAMPLE = [
] ]
# This can be used for hard-coded descriptions COLUMN_DESCRIPTIONS = CONSTANTS["csv_column_descriptions"]
COLUMN_DESCRIPTIONS = {
"BIS ID": "An ID generated by the BIS (either integer or URL to this entity). Do not change this column!",
"BIS label": "The label automatically assigned by the BIS. Do not change this column.",
"Collection": "Collection(s) to which this container or samples belongs (separated by ';')",
"Container Contents": "Notes concerning the contents of this container",
"Container size": "The size of the container (e.g 81 spaces)",
"Container type": "The type of container. Do not change this column.",
"Custom label": "Any additional custom label you put on the container",
"Date collected start": "The start date in format YYYY-MM-DD",
"Date collected stop": "The end date in format YYYY-MM-DD",
"Gear configuration": "How gear is configured, meshsize of the net, filter pore size, what kind of trawl",
"Latitude start": "Latitude where sampling started; in decimal degrees,use \".\" as decimal sign, use - for S",
"Latitude stop": "Latitude where sampling ended; in decimal degrees,use \".\" as decimal sign, use - for S",
"Longitude start": "Longitude where sampling started; in decimal degrees,use \".\" as decimal sign, use - for W",
"Longitude stop": "Longitude where sampling ended; in decimal degrees,use \".\" as decimal sign, use - for W",
"Notes / remarks": "Field for notes",
"PDFReport": "A PDF containing additional information on the container or sampe contents",
"PI": "The PI (by abbreviation) of the container or sample",
"Parent container": "The BIS ID (integer or URL) or name or BIS label of the container where this container is stored.",
"Sampling depth start": "The depth in meters where the sampling started as a positive value, not bottom depth",
"Sampling depth stop": "The depth in meters where the sampling ended as a positive value,not bottom depth",
"Storage ID": "BIS ID of the Container that holds this sample",
"Subevent": "Subevent given by D-Ship in Stationlog. Expl. AL123_14-4",
"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",
}
def get_do_not_insert_type_names(override_names: list[str] = []): def get_do_not_insert_type_names(override_names: list[str] = []):
......
...@@ -36,7 +36,7 @@ from linkahead.exceptions import (EmptyUniqueQueryError, ...@@ -36,7 +36,7 @@ from linkahead.exceptions import (EmptyUniqueQueryError,
from bis_utils import (create_email_with_link_text, from bis_utils import (create_email_with_link_text,
get_description_row, get_email_from_username, get_description_row, get_email_from_username,
send_mail_with_defaults) get_options_row, send_mail_with_defaults)
from sample_helpers.utils import (CONSTANTS, get_column_header_name, from sample_helpers.utils import (CONSTANTS, get_column_header_name,
get_entity_name) get_entity_name)
...@@ -251,8 +251,7 @@ def retrieve_containers(data): ...@@ -251,8 +251,7 @@ def retrieve_containers(data):
try: try:
container.append( container.append(
cached_query( cached_query(
f"FIND RECORD {get_entity_name('container_rt')} WITH id = '{ f"FIND RECORD {get_entity_name('container_rt')} WITH id = '{next_bis_id}'",
next_bis_id}'",
unique=True)) unique=True))
found_at_least_one_in_range = True found_at_least_one_in_range = True
except EmptyUniqueQueryError as e: except EmptyUniqueQueryError as e:
......
...@@ -18,6 +18,33 @@ ...@@ -18,6 +18,33 @@
csv_column_names: csv_column_names:
entity_id: "LinkAhead ID" entity_id: "LinkAhead ID"
csv_column_descriptions:
LinkAhead ID: "An ID generated by LinkAhead (either integer or URL to this entity). Do not change this column!"
container_label: "The label automatically assigned by LinkAhead sample management. Do not change this column."
Collection: "Collection(s) to which this container or samples belongs (separated by ';')"
Container Contents: "Notes concerning the contents of this container"
Container size: "The size of the container (e.g 81 spaces)"
Container type: "The type of container. Do not change this column."
Custom label: "Any additional custom label you put on the container"
Date collected start: "The start date in format YYYY-MM-DD"
Date collected stop: "The end date in format YYYY-MM-DD"
Gear configuration: "How gear is configured, meshsize of the net, filter pore size, what kind of trawl"
Latitude start: "Latitude where sampling started; in decimal degrees,use \".\" as decimal sign, use - for S"
Latitude stop: "Latitude where sampling ended; in decimal degrees,use \".\" as decimal sign, use - for S"
Longitude start: "Longitude where sampling started; in decimal degrees,use \".\" as decimal sign, use - for W"
Longitude stop: "Longitude where sampling ended; in decimal degrees,use \".\" as decimal sign, use - for W"
Notes / remarks: "Field for notes"
PDFReport: "A PDF containing additional information on the container or sampe contents"
PI: "The PI (by abbreviation) of the container or sample"
Parent container: "The LinkAhead ID (integer or URL) or name or BIS label of the container where this container is stored."
Sampling depth start: "The depth in meters where the sampling started as a positive value, not bottom depth"
Sampling depth stop: "The depth in meters where the sampling ended as a positive value,not bottom depth"
Storage ID: "LinkAhead ID of the Container that holds this sample"
Subevent: "Subevent given by D-Ship in Stationlog. Expl. AL123_14-4"
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"
entity_names: entity_names:
abbreviation_prop: Abbreviation abbreviation_prop: Abbreviation
child_container_prop: "Child container" child_container_prop: "Child container"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment