2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-02-08 07:40:19 +00:00

primary key now UUID on SurvexBlock

This commit is contained in:
2026-01-29 23:06:30 +00:00
parent 7a779555ac
commit 1b7798e2fc
3 changed files with 366 additions and 195 deletions

View File

@@ -260,7 +260,15 @@ class QM(TroggleModel):
)
grade = models.CharField(max_length=1, blank=True, null=True, help_text="A/B/C/D/X")
cave = models.ForeignKey("Cave", related_name="QMs", blank=True, null=True, on_delete=models.SET_NULL)
block = models.ForeignKey("SurvexBlock", null=True, on_delete=models.SET_NULL) # only for QMs from survex files
# only for QMs from survex files
block = models.ForeignKey(
"SurvexBlock",
to_field="_blockid", # Explicitly point to the UUID field
null=True,
on_delete=models.SET_NULL
)
# block = models.ForeignKey("SurvexBlock", null=True, on_delete=models.SET_NULL)
blockname = models.TextField(blank=True, null=True) # NB truncated copy of survexblock name with last char added
expoyear = models.CharField(max_length=4, blank=True, null=True)
ticked = models.BooleanField(default=False)