Add a has_refs field to activities #147

This commit is contained in:
Ian Renton
2026-09-18 18:28:30 +01:00
parent e5caf7353d
commit 40033d122e
15 changed files with 158 additions and 124 deletions
+6 -3
View File
@@ -21,6 +21,8 @@ class Activity:
# Type, either Worldwide, Regional or Event. Used for sorting in the web UI.
# Note: this field is still named "sig_type" in the API for backwards compatibility.
sig_type: ActivityType
# Whether this activity has a fixed set of references (e.g. parks) with some sort of ID to "activate"
has_refs: bool
# Identifies that the activity's reference ID structure defined by its regex is unique across all programmes and
# anything else we expect a user to put in a spot comment, and therefore we can pull references out of
# spot comments without also needing to see the activity name first. For example, "OHFF-1234" or "B/G-1234" are
@@ -28,13 +30,14 @@ class Activity:
# conceivably be POTA or ILLW, etc. So in those cases we need to see the name of the activity itself immediately
# before it.
refs_globally_unique: bool
# Activity names as they might appear in cluster spot comments, e.g. ["TOTA"]
comment_names: list[str] = field(default_factory=list)
# Reference type, what gets activated e.g. Park, Summit. May be None if the activity is for multiple types of
# things, in which case the spot data will have to provide this instead.
ref_type: ActivityRefType | None = None
# Regex matcher for references, e.g. for POTA r"[A-Z]{2}\-\d+".
# Regex matcher for references, e.g. for POTA r"[A-Z]{2}\-\d+". Only set when has_references is True and we know
# the fixed format references take for this activity.
ref_regex: str | None = None
# Activity names as they might appear in cluster spot comments, e.g. ["TOTA"]
comment_names: list[str] = field(default_factory=list)
# Icon to use in the UI when referencing this activity. Chosen from the Font Awesome set.
icon: str | None = None
# Emoji flag for the country or region where this activity is relevant, if any. If None, this implies the