mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-15 12:37:10 +00:00
Making entrances work for pending caves
This commit is contained in:
@@ -5,6 +5,7 @@ import re
|
||||
import json
|
||||
from subprocess import call
|
||||
from collections import defaultdict
|
||||
from pathlib import Path
|
||||
|
||||
from urllib.parse import urljoin
|
||||
|
||||
@@ -22,6 +23,20 @@ from django.template import Context, loader
|
||||
from troggle.core.models.troggle import TroggleModel, Person, Expedition, DataIssue
|
||||
from troggle.core.models.survex import SurvexStation
|
||||
|
||||
'''The model declarations for Areas, Caves and Entrances. Also LogBookENtry, QM, PersonTrip
|
||||
'''
|
||||
|
||||
todo='''- Move utility function into utils.py
|
||||
|
||||
- Find out why we have separate objects CaveSlug and EntranceSlug and why
|
||||
these are not just a single field on the Model. Do we ever need more
|
||||
than one slug per cave or entrance? Surely that would break everything??
|
||||
|
||||
- Move PersonTrip to be with Person and Expedition elsewhere
|
||||
|
||||
- Restore constraint: unique_together = (("area", "kataster_number"), ("area", "unofficial_number"))
|
||||
'''
|
||||
|
||||
class Area(TroggleModel):
|
||||
short_name = models.CharField(max_length=100)
|
||||
name = models.CharField(max_length=200, blank=True, null=True)
|
||||
@@ -344,6 +359,9 @@ class Entrance(TroggleModel):
|
||||
self.save()
|
||||
return self.cached_primary_slug
|
||||
|
||||
def get_file_path(self):
|
||||
return Path(settings.ENTRANCEDESCRIPTIONS, self.filename)
|
||||
|
||||
def writeDataFile(self):
|
||||
try:
|
||||
f = open(os.path.join(settings.ENTRANCEDESCRIPTIONS, self.filename), "w")
|
||||
|
||||
Reference in New Issue
Block a user