forked from expo/troggle
start refactor survex import
This commit is contained in:
@@ -3,6 +3,7 @@ import os
|
||||
import datetime
|
||||
import logging
|
||||
import re
|
||||
import resource
|
||||
from subprocess import call
|
||||
|
||||
from urllib.parse import urljoin
|
||||
@@ -22,6 +23,11 @@ from django.template import Context, loader
|
||||
|
||||
import troggle.core.models_survex
|
||||
|
||||
def get_process_memory():
|
||||
usage=resource.getrusage(resource.RUSAGE_SELF)
|
||||
return usage[2]/1024.0
|
||||
|
||||
|
||||
def get_related_by_wikilinks(wiki_text):
|
||||
found=re.findall(settings.QM_PATTERN,wiki_text)
|
||||
res=[]
|
||||
|
||||
@@ -81,13 +81,6 @@ class SurvexStation(models.Model):
|
||||
else:
|
||||
return r
|
||||
|
||||
class SurvexLeg():
|
||||
"""No longer a models.Model subclass, so no longer a database table
|
||||
"""
|
||||
tape = 0.0
|
||||
compass = 0.0
|
||||
clino = 0.0
|
||||
|
||||
#
|
||||
# Single SurvexBlock
|
||||
#
|
||||
|
||||
@@ -12,7 +12,7 @@ from django.views.generic.list import ListView
|
||||
|
||||
from troggle.core.models import Expedition, Person, PersonExpedition
|
||||
from troggle.core.models_caves import Cave, LogbookEntry
|
||||
from troggle.core.models_survex import SurvexLeg, SurvexBlock
|
||||
from troggle.core.models_survex import SurvexBlock
|
||||
|
||||
import troggle.settings as settings
|
||||
|
||||
@@ -106,7 +106,6 @@ def stats(request):
|
||||
legsbyexpo.append((expedition, {"nsurvexlegs": "{:,}".format(legsyear),
|
||||
"survexleglength":"{:,.0f}".format(survexleglength)}))
|
||||
legsbyexpo.reverse()
|
||||
#survexlegs = SurvexLeg.objects.all()
|
||||
|
||||
renderDict = {**statsDict, **{ "nsurvexlegs": "{:,}".format(nimportlegs), "totalsurvexlength":totalsurvexlength/1000, "addupsurvexlength":addupsurvexlength/1000, "legsbyexpo":legsbyexpo }} # new syntax
|
||||
return render(request,'statistics.html', renderDict)
|
||||
|
||||
Reference in New Issue
Block a user