2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 08:41:51 +00:00

minor refactoring

This commit is contained in:
Philip Sargent 2022-08-16 17:42:37 +03:00
parent 1a49e5347f
commit aaba4fd2a9
3 changed files with 26 additions and 19 deletions

View File

@ -257,6 +257,13 @@ class Wallet(models.Model):
ticks = {}
waldata = self.get_json()
if not waldata:
ticks["S"] = "black"
ticks["C"] = "black"
ticks["Q"] = "black"
ticks["N"] = "black"
ticks["P"] = "black"
ticks["E"] = "black"
ticks["T"] = "black"
ticks["W"] = "black"
return ticks
ticks = {}

View File

@ -23,7 +23,7 @@ from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
#from troggle import settings
from troggle.parsers.imports import import_caves, import_people, import_surveyscans
from troggle.parsers.imports import import_logbooks, import_QMs, import_drawingsfiles, import_survex
from troggle.parsers.scans import wallet_blank_json, contentsjson
from troggle.parsers.scans import contentsjson
# from databaseReset import reinit_db # don't do this. databaseRest runs code *at import time*
from troggle.core.models.troggle import DataIssue
from troggle.core.models.troggle import Expedition, Person, PersonExpedition
@ -56,6 +56,24 @@ todo = '''
- Enable folder creation in dwguploads or as a separate form
'''
wallet_blank_json = {
"cave": "",
"date": "",
"description url": "1623/XXX",
"description written": False,
"electronic survey": False,
"elev drawn": False,
"elev not required": False,
"name": "",
"people": [
"Unknown"
],
"plan drawn": False,
"plan not required": False,
"qms written": False,
"survex file": [],
"survex not required": False,
"website updated": False}
class FilesForm(forms.Form): # not a model-form, just a form-form
uploadfiles = forms.FileField()

View File

@ -25,24 +25,6 @@ contentsjson = "contents.json"
git = settings.GIT
# to do: create a 'low priority' field, so that any such wallet does not appear in summary reports
wallet_blank_json = {
"cave": "",
"date": "",
"description url": "1623/XXX",
"description written": False,
"electronic survey": False,
"elev drawn": False,
"elev not required": False,
"name": "",
"people": [
"Unknown"
],
"plan drawn": False,
"plan not required": False,
"qms written": False,
"survex file": [],
"survex not required": False,
"website updated": False}
def CheckEmptyDate(wallet):