From 957169d9aa0592fb2262ca28d3433c040204758e Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Tue, 13 Apr 2021 00:47:17 +0100 Subject: [PATCH] move models_caves to models/caves.py --- core/TESTS/test_imports.py | 10 +++++----- core/admin.py | 2 +- core/forms.py | 2 +- core/{models_caves.py => models/caves.py} | 0 core/templatetags/wiki_markup.py | 2 +- core/views/caves.py | 2 +- core/views/expo.py | 2 +- core/views/logbooks.py | 2 +- core/views/other.py | 2 +- core/views/statistics.py | 2 +- core/views/survex.py | 2 +- databaseReset.py | 2 +- logbooksdump.py | 2 +- parsers/QMs.py | 2 +- parsers/caves.py | 2 +- parsers/logbooks.py | 2 +- parsers/survex.py | 2 +- 17 files changed, 20 insertions(+), 20 deletions(-) rename core/{models_caves.py => models/caves.py} (100%) diff --git a/core/TESTS/test_imports.py b/core/TESTS/test_imports.py index 01e76c7..8c5abe3 100644 --- a/core/TESTS/test_imports.py +++ b/core/TESTS/test_imports.py @@ -29,7 +29,7 @@ class SimpleTest(SimpleTestCase): def test_import_TroggleModel(self): from troggle.core.models.troggle import TroggleModel 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): from PIL import Image from troggle.core.utils import save_carefully @@ -37,12 +37,12 @@ class SimpleTest(SimpleTestCase): def test_import_parsers_survex(self): import troggle.settings as settings 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 from troggle.parsers.people import GetPersonExpeditionNameLookup from troggle.core.views.caves import MapLocations 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): from html.parser import HTMLParser from unidecode import unidecode @@ -50,14 +50,14 @@ class SimpleTest(SimpleTestCase): from django.template.defaultfilters import slugify from django.utils.timezone import get_current_timezone, make_aware 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 def test_import_core_views_caves(self): from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import get_object_or_404, render import troggle.core.views.expo 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.views.login import login_required_if_public from django.contrib.auth.decorators import login_required diff --git a/core/admin.py b/core/admin.py index 0a9015b..4adb153 100644 --- a/core/admin.py +++ b/core/admin.py @@ -6,7 +6,7 @@ from django.core import serializers from troggle.core.views.other import downloadLogbook 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 '''This code significantly adds to the capabilities of the Django Management control panel for Troggle data. diff --git a/core/forms.py b/core/forms.py index c7eb551..73d541a 100644 --- a/core/forms.py +++ b/core/forms.py @@ -9,7 +9,7 @@ from django.contrib.admin.widgets import AdminDateWidget #from tinymce.widgets import TinyMCE 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): underground_description = forms.CharField(required = False, widget=forms.Textarea()) diff --git a/core/models_caves.py b/core/models/caves.py similarity index 100% rename from core/models_caves.py rename to core/models/caves.py diff --git a/core/templatetags/wiki_markup.py b/core/templatetags/wiki_markup.py index fff2836..276586a 100644 --- a/core/templatetags/wiki_markup.py +++ b/core/templatetags/wiki_markup.py @@ -3,7 +3,7 @@ from django.utils.html import conditional_escape from django.template.defaultfilters import stringfilter from django.utils.safestring import mark_safe 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 register = template.Library() diff --git a/core/views/caves.py b/core/views/caves.py index 8c02ea2..8884d46 100644 --- a/core/views/caves.py +++ b/core/views/caves.py @@ -18,7 +18,7 @@ import troggle.settings as settings #import troggle.core.models as models from troggle.core.views import expo 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 .login import login_required_if_public diff --git a/core/views/expo.py b/core/views/expo.py index 0a95011..84f979c 100644 --- a/core/views/expo.py +++ b/core/views/expo.py @@ -14,7 +14,7 @@ from django.contrib import admin import django.forms as forms 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.settings as settings diff --git a/core/views/logbooks.py b/core/views/logbooks.py index f74c21f..2729135 100644 --- a/core/views/logbooks.py +++ b/core/views/logbooks.py @@ -16,7 +16,7 @@ from django.views.generic.list import ListView from troggle.core.forms import getTripForm # , get_name, PersonForm from troggle.core.models.troggle import Expedition, Person, PersonExpedition 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 .login import login_required_if_public from troggle.parsers.logbooks import LoadLogbookForExpedition diff --git a/core/views/other.py b/core/views/other.py index 30b3093..569264b 100644 --- a/core/views/other.py +++ b/core/views/other.py @@ -10,7 +10,7 @@ from django.template import Context, loader import troggle.parsers.imports 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 troggle.core.forms import UploadFileForm diff --git a/core/views/statistics.py b/core/views/statistics.py index 9c45f9f..bc6bced 100644 --- a/core/views/statistics.py +++ b/core/views/statistics.py @@ -12,7 +12,7 @@ from django.utils import timezone #from django.views.generic.list import ListView 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 import troggle.settings as settings diff --git a/core/views/survex.py b/core/views/survex.py index 3aee5f8..46ddb88 100644 --- a/core/views/survex.py +++ b/core/views/survex.py @@ -16,7 +16,7 @@ import troggle.settings as settings import parsers.survex from troggle.core.models.troggle import Expedition, Person, PersonExpedition 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 survexdatasetpath = Path(settings.SURVEX_DATA) diff --git a/databaseReset.py b/databaseReset.py index aec6922..a21bd30 100644 --- a/databaseReset.py +++ b/databaseReset.py @@ -44,7 +44,7 @@ from django.contrib.auth.models import User from django.db import transaction 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, \ import_logbooks, import_QMs, import_survex, import_loadpos, import_drawingsfiles import troggle.logbooksdump diff --git a/logbooksdump.py b/logbooksdump.py index 85edeca..a2a4d8e 100644 --- a/logbooksdump.py +++ b/logbooksdump.py @@ -18,7 +18,7 @@ from django.contrib.auth.models import User from django.http import HttpResponse 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(): diff --git a/parsers/QMs.py b/parsers/QMs.py index 2816c8a..3a3e2bb 100644 --- a/parsers/QMs.py +++ b/parsers/QMs.py @@ -6,7 +6,7 @@ from datetime import date from django.conf import settings 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 diff --git a/parsers/caves.py b/parsers/caves.py index 8ddc424..72b84cd 100644 --- a/parsers/caves.py +++ b/parsers/caves.py @@ -5,7 +5,7 @@ from django.conf import settings from django.db import transaction 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 ) and creating the various Cave, Entrance and necessary Area objects. diff --git a/parsers/logbooks.py b/parsers/logbooks.py index 58e425b..c24af07 100644 --- a/parsers/logbooks.py +++ b/parsers/logbooks.py @@ -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.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 # diff --git a/parsers/survex.py b/parsers/survex.py index 42c1a10..0a5bf33 100644 --- a/parsers/survex.py +++ b/parsers/survex.py @@ -13,7 +13,7 @@ from django.utils.timezone import make_aware import troggle.settings as settings 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 from troggle.core.utils import get_process_memory, chaosmonkey from troggle.parsers.people import GetPersonExpeditionNameLookup