forked from expo/troggle
Made a prospecting guide and fixed survex station description. Removed parsing of underground descriptions to wikis.
This commit is contained in:
@@ -385,6 +385,20 @@ class Cave(TroggleModel):
|
||||
|
||||
#href = models.CharField(max_length=100)
|
||||
|
||||
def hassurvey(self):
|
||||
if not self.underground_centre_line:
|
||||
return "No"
|
||||
if (self.underground_centre_line.find("<img") > -1 or self.underground_centre_line.find("<a") > -1):
|
||||
return "Yes"
|
||||
return "Missing"
|
||||
|
||||
def hassurveydata(self):
|
||||
if not self.underground_centre_line:
|
||||
return "No"
|
||||
if self.survex_file:
|
||||
return "Yes"
|
||||
return "Missing"
|
||||
|
||||
def slug(self):
|
||||
primarySlugs = self.caveslug_set.filter(primary = True)
|
||||
if primarySlugs:
|
||||
@@ -394,6 +408,9 @@ class Cave(TroggleModel):
|
||||
if slugs:
|
||||
return slugs[0].slug
|
||||
|
||||
def ours(self):
|
||||
return bool(re.search(r'CUCC', self.explorers))
|
||||
|
||||
def reference(self):
|
||||
if self.kataster_number:
|
||||
return "%s-%s" % (self.kat_area(), self.kataster_number)
|
||||
@@ -431,6 +448,9 @@ class Cave(TroggleModel):
|
||||
|
||||
def entrances(self):
|
||||
return CaveAndEntrance.objects.filter(cave=self)
|
||||
|
||||
def singleentrance(self):
|
||||
return len(CaveAndEntrance.objects.filter(cave=self)) == 1
|
||||
|
||||
def entrancelist(self):
|
||||
rs = []
|
||||
@@ -534,6 +554,29 @@ class Entrance(TroggleModel):
|
||||
|
||||
def __unicode__(self):
|
||||
return unicode(self.slug())
|
||||
|
||||
def find_location(self):
|
||||
if self.tag_station:
|
||||
s = SurvexStation.objects.lookup(self.tag_station)
|
||||
return "%sE %sN %sAlt" % (s.x, s.y, s.z)
|
||||
if self.exact_station:
|
||||
s = SurvexStation.objects.lookup(self.exact_station)
|
||||
return "%sE %sN %sAlt" % (s.x, s.y, s.z)
|
||||
if self.other_station:
|
||||
s = SurvexStation.objects.lookup(self.other_station)
|
||||
return "%sE %sN %sAlt %s" % (s.x, s.y, s.z, self.other_description)
|
||||
if self.bearings:
|
||||
return self.bearings
|
||||
|
||||
def has_photo(self):
|
||||
if self.photo:
|
||||
if (self.photo.find("<img") > -1 or self.photo.find("<a") > -1):
|
||||
return "Yes"
|
||||
else:
|
||||
return "Missing"
|
||||
else:
|
||||
return "No"
|
||||
|
||||
def marking_val(self):
|
||||
for m in self.MARKING_CHOICES:
|
||||
if m[0] == self.marking:
|
||||
|
||||
@@ -93,7 +93,10 @@ class SurvexLeg(models.Model):
|
||||
#
|
||||
class SurvexBlockLookUpManager(models.Manager):
|
||||
def lookup(self, name):
|
||||
blocknames = name.split(".")
|
||||
if name == "":
|
||||
blocknames = []
|
||||
else:
|
||||
blocknames = name.split(".")
|
||||
block = SurvexBlock.objects.get(parent=None, survexfile__path="all")
|
||||
for blockname in blocknames:
|
||||
block = SurvexBlock.objects.get(parent=block, name__iexact=blockname)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from troggle.core.models import Cave, CaveAndEntrance, Survey, Expedition, QM, CaveDescription, Entrance
|
||||
from troggle.core.models import Cave, CaveAndEntrance, Survey, Expedition, QM, CaveDescription, Entrance, Area
|
||||
from troggle.core.forms import CaveForm, CaveAndEntranceFormSet, VersionControlCommentForm, EntranceForm
|
||||
import troggle.core.models as models
|
||||
import troggle.settings as settings
|
||||
@@ -204,3 +204,35 @@ def get_entrances(request, caveslug):
|
||||
def get_qms(request, caveslug):
|
||||
cave = Cave.objects.get(caveslug__slug = caveslug)
|
||||
return render_with_context(request,'options.html', {"items": [(e.entrance.slug(), e.entrance.slug()) for e in cave.entrances()]})
|
||||
|
||||
areanames = [
|
||||
#('', 'Location unclear'),
|
||||
('1a', '1a – Plateau: around Top Camp'),
|
||||
('1b', '1b – Western plateau near 182'),
|
||||
('1c', '1c – Eastern plateau near 204 walk-in path'),
|
||||
('1d', '1d – Further plateau around 76'),
|
||||
('2a', '2a – Southern Schwarzmooskogel near 201 path and the Nipple'),
|
||||
('2b', '2b – Eishöhle area'),
|
||||
('2c', '2c – Kaninchenhöhle area'),
|
||||
('2d', '2d – Steinbrückenhöhle area'),
|
||||
('3', '3 – Bräuning Alm'),
|
||||
('4', '4 – Kratzer valley'),
|
||||
('5', '5 – Schwarzmoos-Wildensee'),
|
||||
('6', '6 – Far plateau'),
|
||||
('7', '7 – Egglgrube'),
|
||||
('8a', '8a – Loser south face'),
|
||||
('8b', '8b – Loser below Dimmelwand'),
|
||||
('8c', '8c – Augst See'),
|
||||
('8d', '8d – Loser-Hochganger ridge'),
|
||||
('9', '9 – Gschwandt Alm'),
|
||||
('10', '10 – Altaussee'),
|
||||
('11', '11 – Augstbach')
|
||||
]
|
||||
|
||||
|
||||
def prospecting(request):
|
||||
for key, name in areanames:
|
||||
print key, Area.objects.get(short_name = key)
|
||||
areas = [ (name, Area.objects.get(short_name = key)) for key, name in areanames ]
|
||||
return render_with_context(request,'prospecting.html', {"areas": areas})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user