forked from expo/troggle
move models_caves to models/caves.py
This commit is contained in:
parent
5b3b0e67e9
commit
957169d9aa
@ -29,7 +29,7 @@ class SimpleTest(SimpleTestCase):
|
|||||||
def test_import_TroggleModel(self):
|
def test_import_TroggleModel(self):
|
||||||
from troggle.core.models.troggle import TroggleModel
|
from troggle.core.models.troggle import TroggleModel
|
||||||
def test_import_Cave(self):
|
def test_import_Cave(self):
|
||||||
from troggle.core.models_caves import Cave
|
from troggle.core.models.caves import Cave
|
||||||
def test_import_parsers_surveys(self):
|
def test_import_parsers_surveys(self):
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
from troggle.core.utils import save_carefully
|
from troggle.core.utils import save_carefully
|
||||||
@ -37,12 +37,12 @@ class SimpleTest(SimpleTestCase):
|
|||||||
def test_import_parsers_survex(self):
|
def test_import_parsers_survex(self):
|
||||||
import troggle.settings as settings
|
import troggle.settings as settings
|
||||||
import troggle.core.models.troggle as models
|
import troggle.core.models.troggle as models
|
||||||
import troggle.core.models_caves as models_caves
|
import troggle.core.models.caves as models_caves
|
||||||
import troggle.core.models_survex as models_survex
|
import troggle.core.models_survex as models_survex
|
||||||
from troggle.parsers.people import GetPersonExpeditionNameLookup
|
from troggle.parsers.people import GetPersonExpeditionNameLookup
|
||||||
from troggle.core.views.caves import MapLocations
|
from troggle.core.views.caves import MapLocations
|
||||||
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.caves import QM, Cave, LogbookEntry
|
||||||
def test_import_parsers_people(self):
|
def test_import_parsers_people(self):
|
||||||
from html.parser import HTMLParser
|
from html.parser import HTMLParser
|
||||||
from unidecode import unidecode
|
from unidecode import unidecode
|
||||||
@ -50,14 +50,14 @@ class SimpleTest(SimpleTestCase):
|
|||||||
from django.template.defaultfilters import slugify
|
from django.template.defaultfilters import slugify
|
||||||
from django.utils.timezone import get_current_timezone, make_aware
|
from django.utils.timezone import get_current_timezone, make_aware
|
||||||
from troggle.core.models.troggle import DataIssue, Expedition
|
from troggle.core.models.troggle import DataIssue, Expedition
|
||||||
from troggle.core.models_caves import Cave, LogbookEntry, PersonTrip
|
from troggle.core.models.caves import Cave, LogbookEntry, PersonTrip
|
||||||
from parsers.people import GetPersonExpeditionNameLookup
|
from parsers.people import GetPersonExpeditionNameLookup
|
||||||
def test_import_core_views_caves(self):
|
def test_import_core_views_caves(self):
|
||||||
from django.http import HttpResponse, HttpResponseRedirect
|
from django.http import HttpResponse, HttpResponseRedirect
|
||||||
from django.shortcuts import get_object_or_404, render
|
from django.shortcuts import get_object_or_404, render
|
||||||
import troggle.core.views.expo
|
import troggle.core.views.expo
|
||||||
from troggle.core.models.troggle import Expedition
|
from troggle.core.models.troggle import Expedition
|
||||||
from troggle.core.models_caves import CaveSlug, Cave, CaveAndEntrance, QM, EntranceSlug, Entrance, Area, SurvexStation
|
from troggle.core.models.caves import CaveSlug, Cave, CaveAndEntrance, QM, EntranceSlug, Entrance, Area, SurvexStation
|
||||||
from troggle.core.forms import CaveForm, CaveAndEntranceFormSet, VersionControlCommentForm, EntranceForm, EntranceLetterForm
|
from troggle.core.forms import CaveForm, CaveAndEntranceFormSet, VersionControlCommentForm, EntranceForm, EntranceLetterForm
|
||||||
from troggle.core.views.login import login_required_if_public
|
from troggle.core.views.login import login_required_if_public
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
|
@ -6,7 +6,7 @@ from django.core import serializers
|
|||||||
|
|
||||||
from troggle.core.views.other import downloadLogbook
|
from troggle.core.views.other import downloadLogbook
|
||||||
from troggle.core.models.troggle import Person, PersonExpedition, Expedition, DataIssue
|
from troggle.core.models.troggle import Person, PersonExpedition, Expedition, DataIssue
|
||||||
from troggle.core.models_caves import Cave, Area, Entrance, CaveAndEntrance, LogbookEntry, PersonTrip, QM
|
from troggle.core.models.caves import Cave, Area, Entrance, CaveAndEntrance, LogbookEntry, PersonTrip, QM
|
||||||
from troggle.core.models_survex import SurvexBlock, SurvexPersonRole, SurvexStation, ScansFolder, SingleScan
|
from troggle.core.models_survex import SurvexBlock, SurvexPersonRole, SurvexStation, ScansFolder, SingleScan
|
||||||
|
|
||||||
'''This code significantly adds to the capabilities of the Django Management control panel for Troggle data.
|
'''This code significantly adds to the capabilities of the Django Management control panel for Troggle data.
|
||||||
|
@ -9,7 +9,7 @@ from django.contrib.admin.widgets import AdminDateWidget
|
|||||||
#from tinymce.widgets import TinyMCE
|
#from tinymce.widgets import TinyMCE
|
||||||
|
|
||||||
from troggle.core.models.troggle import Person, PersonExpedition, Expedition
|
from troggle.core.models.troggle import Person, PersonExpedition, Expedition
|
||||||
from troggle.core.models_caves import Cave, LogbookEntry, QM, Entrance, CaveAndEntrance
|
from troggle.core.models.caves import Cave, LogbookEntry, QM, Entrance, CaveAndEntrance
|
||||||
|
|
||||||
class CaveForm(ModelForm):
|
class CaveForm(ModelForm):
|
||||||
underground_description = forms.CharField(required = False, widget=forms.Textarea())
|
underground_description = forms.CharField(required = False, widget=forms.Textarea())
|
||||||
|
@ -3,7 +3,7 @@ from django.utils.html import conditional_escape
|
|||||||
from django.template.defaultfilters import stringfilter
|
from django.template.defaultfilters import stringfilter
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from troggle.core.models_caves import LogbookEntry, QM, Cave
|
from troggle.core.models.caves import LogbookEntry, QM, Cave
|
||||||
import re, urllib.parse
|
import re, urllib.parse
|
||||||
|
|
||||||
register = template.Library()
|
register = template.Library()
|
||||||
|
@ -18,7 +18,7 @@ import troggle.settings as settings
|
|||||||
#import troggle.core.models as models
|
#import troggle.core.models as models
|
||||||
from troggle.core.views import expo
|
from troggle.core.views import expo
|
||||||
from troggle.core.models.troggle import Expedition, DataIssue
|
from troggle.core.models.troggle import Expedition, DataIssue
|
||||||
from troggle.core.models_caves import CaveSlug, Cave, CaveAndEntrance, QM, EntranceSlug, Entrance, Area, SurvexStation, GetCaveLookup
|
from troggle.core.models.caves import CaveSlug, Cave, CaveAndEntrance, QM, EntranceSlug, Entrance, Area, SurvexStation, GetCaveLookup
|
||||||
from troggle.core.forms import CaveForm, CaveAndEntranceFormSet, VersionControlCommentForm, EntranceForm, EntranceLetterForm
|
from troggle.core.forms import CaveForm, CaveAndEntranceFormSet, VersionControlCommentForm, EntranceForm, EntranceLetterForm
|
||||||
from .login import login_required_if_public
|
from .login import login_required_if_public
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ from django.contrib import admin
|
|||||||
import django.forms as forms
|
import django.forms as forms
|
||||||
|
|
||||||
from .login import login_required_if_public
|
from .login import login_required_if_public
|
||||||
from troggle.core.models_caves import Cave
|
from troggle.core.models.caves import Cave
|
||||||
import troggle.core.views.caves
|
import troggle.core.views.caves
|
||||||
import troggle.settings as settings
|
import troggle.settings as settings
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ from django.views.generic.list import ListView
|
|||||||
from troggle.core.forms import getTripForm # , get_name, PersonForm
|
from troggle.core.forms import getTripForm # , get_name, PersonForm
|
||||||
from troggle.core.models.troggle import Expedition, Person, PersonExpedition
|
from troggle.core.models.troggle import Expedition, Person, PersonExpedition
|
||||||
from troggle.core.utils import TROG
|
from troggle.core.utils import TROG
|
||||||
from troggle.core.models_caves import LogbookEntry, PersonTrip
|
from troggle.core.models.caves import LogbookEntry, PersonTrip
|
||||||
from troggle.core.models_survex import SurvexBlock
|
from troggle.core.models_survex import SurvexBlock
|
||||||
from .login import login_required_if_public
|
from .login import login_required_if_public
|
||||||
from troggle.parsers.logbooks import LoadLogbookForExpedition
|
from troggle.parsers.logbooks import LoadLogbookForExpedition
|
||||||
|
@ -10,7 +10,7 @@ from django.template import Context, loader
|
|||||||
|
|
||||||
import troggle.parsers.imports
|
import troggle.parsers.imports
|
||||||
from troggle.core.models.troggle import Expedition, Person, PersonExpedition
|
from troggle.core.models.troggle import Expedition, Person, PersonExpedition
|
||||||
from troggle.core.models_caves import LogbookEntry, QM, Cave, PersonTrip
|
from troggle.core.models.caves import LogbookEntry, QM, Cave, PersonTrip
|
||||||
from .login import login_required_if_public
|
from .login import login_required_if_public
|
||||||
from troggle.core.forms import UploadFileForm
|
from troggle.core.forms import UploadFileForm
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ from django.utils import timezone
|
|||||||
#from django.views.generic.list import ListView
|
#from django.views.generic.list import ListView
|
||||||
|
|
||||||
from troggle.core.models.troggle import Expedition, Person, PersonExpedition, DataIssue
|
from troggle.core.models.troggle import Expedition, Person, PersonExpedition, DataIssue
|
||||||
from troggle.core.models_caves import Cave, LogbookEntry
|
from troggle.core.models.caves import Cave, LogbookEntry
|
||||||
from troggle.core.models_survex import SurvexBlock
|
from troggle.core.models_survex import SurvexBlock
|
||||||
|
|
||||||
import troggle.settings as settings
|
import troggle.settings as settings
|
||||||
|
@ -16,7 +16,7 @@ import troggle.settings as settings
|
|||||||
import parsers.survex
|
import parsers.survex
|
||||||
from troggle.core.models.troggle import Expedition, Person, PersonExpedition
|
from troggle.core.models.troggle import Expedition, Person, PersonExpedition
|
||||||
from troggle.core.models_survex import SurvexBlock, SurvexPersonRole, SurvexFile, SurvexDirectory
|
from troggle.core.models_survex import SurvexBlock, SurvexPersonRole, SurvexFile, SurvexDirectory
|
||||||
from troggle.core.models_caves import Cave, PersonTrip, LogbookEntry
|
from troggle.core.models.caves import Cave, PersonTrip, LogbookEntry
|
||||||
from troggle.parsers.people import GetPersonExpeditionNameLookup
|
from troggle.parsers.people import GetPersonExpeditionNameLookup
|
||||||
|
|
||||||
survexdatasetpath = Path(settings.SURVEX_DATA)
|
survexdatasetpath = Path(settings.SURVEX_DATA)
|
||||||
|
@ -44,7 +44,7 @@ from django.contrib.auth.models import User
|
|||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
|
|
||||||
from troggle.core.utils import get_process_memory
|
from troggle.core.utils import get_process_memory
|
||||||
from troggle.core.models_caves import Cave, Entrance
|
from troggle.core.models.caves import Cave, Entrance
|
||||||
from troggle.parsers.imports import import_caves, import_people, import_surveyscans, \
|
from troggle.parsers.imports import import_caves, import_people, import_surveyscans, \
|
||||||
import_logbooks, import_QMs, import_survex, import_loadpos, import_drawingsfiles
|
import_logbooks, import_QMs, import_survex, import_loadpos, import_drawingsfiles
|
||||||
import troggle.logbooksdump
|
import troggle.logbooksdump
|
||||||
|
@ -18,7 +18,7 @@ from django.contrib.auth.models import User
|
|||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
from troggle.core.models_caves import Cave, Entrance
|
from troggle.core.models.caves import Cave, Entrance
|
||||||
|
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
def import_auto_logbooks():
|
def import_auto_logbooks():
|
||||||
|
@ -6,7 +6,7 @@ from datetime import date
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
from troggle.core.models.troggle import DataIssue
|
from troggle.core.models.troggle import DataIssue
|
||||||
from troggle.core.models_caves import QM, Cave, LogbookEntry
|
from troggle.core.models.caves import QM, Cave, LogbookEntry
|
||||||
from troggle.core.utils import save_carefully
|
from troggle.core.utils import save_carefully
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ from django.conf import settings
|
|||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
|
|
||||||
from troggle.core.models.troggle import DataIssue
|
from troggle.core.models.troggle import DataIssue
|
||||||
from troggle.core.models_caves import Area, Cave, Entrance, CaveSlug, EntranceSlug, CaveAndEntrance
|
from troggle.core.models.caves import Area, Cave, Entrance, CaveSlug, EntranceSlug, CaveAndEntrance
|
||||||
'''Reads all the cave description data by parsing the xml files (stored as e.g. :EXPOWEB:/cave-data/1623-161.html )
|
'''Reads all the cave description data by parsing the xml files (stored as e.g. :EXPOWEB:/cave-data/1623-161.html )
|
||||||
and creating the various Cave, Entrance and necessary Area objects.
|
and creating the various Cave, Entrance and necessary Area objects.
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ from django.utils.timezone import get_current_timezone, make_aware
|
|||||||
|
|
||||||
from troggle.core.models.troggle import DataIssue, Expedition
|
from troggle.core.models.troggle import DataIssue, Expedition
|
||||||
from troggle.core.utils import TROG, save_carefully
|
from troggle.core.utils import TROG, save_carefully
|
||||||
from troggle.core.models_caves import Cave, LogbookEntry, PersonTrip, GetCaveLookup
|
from troggle.core.models.caves import Cave, LogbookEntry, PersonTrip, GetCaveLookup
|
||||||
from parsers.people import GetPersonExpeditionNameLookup
|
from parsers.people import GetPersonExpeditionNameLookup
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -13,7 +13,7 @@ from django.utils.timezone import make_aware
|
|||||||
|
|
||||||
import troggle.settings as settings
|
import troggle.settings as settings
|
||||||
import troggle.core.models as models
|
import troggle.core.models as models
|
||||||
import troggle.core.models_caves as models_caves
|
import troggle.core.models.caves as models_caves
|
||||||
import troggle.core.models_survex as models_survex
|
import troggle.core.models_survex as models_survex
|
||||||
from troggle.core.utils import get_process_memory, chaosmonkey
|
from troggle.core.utils import get_process_memory, chaosmonkey
|
||||||
from troggle.parsers.people import GetPersonExpeditionNameLookup
|
from troggle.parsers.people import GetPersonExpeditionNameLookup
|
||||||
|
Loading…
Reference in New Issue
Block a user