mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-22 07:11:52 +00:00
bugfix from rearranged model files
This commit is contained in:
parent
79bccade02
commit
a1c34f488d
@ -52,7 +52,7 @@ class SimpleTest(SimpleTestCase):
|
|||||||
def test_import_views_uploads(self):
|
def test_import_views_uploads(self):
|
||||||
from troggle.core.views.uploads import dwgupload, scanupload
|
from troggle.core.views.uploads import dwgupload, scanupload
|
||||||
def test_import_parsers_QMs(self):
|
def test_import_parsers_QMs(self):
|
||||||
from troggle.core.models.caves import QM, Cave, LogbookEntry
|
from troggle.core.models.logbooks import QM
|
||||||
def test_import_parsers_people(self):
|
def test_import_parsers_people(self):
|
||||||
from html import unescape
|
from html import unescape
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ class SimpleTest(SimpleTestCase):
|
|||||||
from django.utils.timezone import get_current_timezone, make_aware
|
from django.utils.timezone import get_current_timezone, make_aware
|
||||||
|
|
||||||
from parsers.people import GetPersonExpeditionNameLookup
|
from parsers.people import GetPersonExpeditionNameLookup
|
||||||
from troggle.core.models.caves import Cave, LogbookEntry, PersonTrip
|
from troggle.core.models.logbooks import LogbookEntry, PersonTrip
|
||||||
from troggle.core.models.troggle import DataIssue, Expedition
|
from troggle.core.models.troggle import DataIssue, Expedition
|
||||||
def test_import_core_views_caves(self):
|
def test_import_core_views_caves(self):
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
@ -73,7 +73,7 @@ class SimpleTest(SimpleTestCase):
|
|||||||
import troggle.core.views.expo
|
import troggle.core.views.expo
|
||||||
from troggle.core.forms import (CaveAndEntranceFormSet, CaveForm,
|
from troggle.core.forms import (CaveAndEntranceFormSet, CaveForm,
|
||||||
EntranceForm, EntranceLetterForm)
|
EntranceForm, EntranceLetterForm)
|
||||||
from troggle.core.models.caves import (QM, Area, Cave, CaveAndEntrance,
|
from troggle.core.models.caves import (Area, Cave, CaveAndEntrance,
|
||||||
CaveSlug, Entrance,
|
CaveSlug, Entrance,
|
||||||
EntranceSlug, SurvexStation)
|
EntranceSlug, SurvexStation)
|
||||||
from troggle.core.models.troggle import Expedition
|
from troggle.core.models.troggle import Expedition
|
||||||
|
@ -21,6 +21,7 @@ from django.template import Context, loader
|
|||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
import settings
|
import settings
|
||||||
|
from troggle.core.models.logbooks import QM
|
||||||
from troggle.core.models.survex import SurvexStation
|
from troggle.core.models.survex import SurvexStation
|
||||||
from troggle.core.models.troggle import (DataIssue, Expedition, Person,
|
from troggle.core.models.troggle import (DataIssue, Expedition, Person,
|
||||||
TroggleModel)
|
TroggleModel)
|
||||||
|
@ -21,11 +21,9 @@ from django.template import Context, loader
|
|||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
import settings
|
import settings
|
||||||
from troggle.core.models.caves import (Area, Cave, CaveAndEntrance,
|
|
||||||
Entrance)
|
|
||||||
from troggle.core.models.survex import SurvexStation
|
from troggle.core.models.survex import SurvexStation
|
||||||
from troggle.core.models.troggle import (DataIssue, Expedition, Person,
|
from troggle.core.models.troggle import (DataIssue, Expedition, Person,
|
||||||
TroggleModel)
|
PersonExpedition, TroggleModel)
|
||||||
|
|
||||||
'''The model declarations LogBookEntry, PersonTrip, QM
|
'''The model declarations LogBookEntry, PersonTrip, QM
|
||||||
'''
|
'''
|
||||||
@ -111,7 +109,7 @@ class QM(TroggleModel):
|
|||||||
"""This is based on qm.csv in trunk/expoweb/1623/204 which has the fields:
|
"""This is based on qm.csv in trunk/expoweb/1623/204 which has the fields:
|
||||||
"Number","Grade","Area","Description","Page reference","Nearest station","Completion description","Comment"
|
"Number","Grade","Area","Description","Page reference","Nearest station","Completion description","Comment"
|
||||||
"""
|
"""
|
||||||
cave = models.ForeignKey(Cave, related_name='QMs',blank=True, null=True,on_delete=models.SET_NULL )
|
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
|
block = models.ForeignKey('SurvexBlock', null=True,on_delete=models.SET_NULL) # only for QMs from survex files
|
||||||
blockname=models.TextField(blank=True,null=True) # NB truncated copy of survexblock name with last char added
|
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) # could change to datetime if logbooks similarly chnaged
|
expoyear = models.CharField(max_length=4,blank=True, null=True) # could change to datetime if logbooks similarly chnaged
|
||||||
@ -130,7 +128,7 @@ class QM(TroggleModel):
|
|||||||
location_description = models.TextField(blank=True)
|
location_description = models.TextField(blank=True)
|
||||||
nearest_station_description = models.CharField(max_length=400,blank=True, null=True)
|
nearest_station_description = models.CharField(max_length=400,blank=True, null=True)
|
||||||
nearest_station_name = models.CharField(max_length=200,blank=True, null=True)
|
nearest_station_name = models.CharField(max_length=200,blank=True, null=True)
|
||||||
nearest_station = models.ForeignKey(SurvexStation,blank=True, null=True,on_delete=models.SET_NULL)
|
nearest_station = models.ForeignKey('SurvexStation',blank=True, null=True,on_delete=models.SET_NULL)
|
||||||
area = models.CharField(max_length=100,blank=True, null=True)
|
area = models.CharField(max_length=100,blank=True, null=True)
|
||||||
completion_description = models.TextField(blank=True,null=True)
|
completion_description = models.TextField(blank=True,null=True)
|
||||||
comment=models.TextField(blank=True,null=True)
|
comment=models.TextField(blank=True,null=True)
|
||||||
@ -178,4 +176,4 @@ class QM(TroggleModel):
|
|||||||
|
|
||||||
def get_previous_by_id(self):
|
def get_previous_by_id(self):
|
||||||
return QM.objects.get(id=self.id-1)
|
return QM.objects.get(id=self.id-1)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user