summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2021-05-07 19:38:26 +0100
committerPhilip Sargent <philip.sargent@klebos.com>2021-05-07 19:38:26 +0100
commit4cd7367a7e12ffec4004dc4003678504e3603555 (patch)
tree3b6dc81a1ded9e03c5e8914046ea92a04066597e /core
parent47d9d7d24289fc4715898cd82444cf592492108d (diff)
downloadtroggle-4cd7367a7e12ffec4004dc4003678504e3603555.tar.gz
troggle-4cd7367a7e12ffec4004dc4003678504e3603555.tar.bz2
troggle-4cd7367a7e12ffec4004dc4003678504e3603555.zip
remove commented out bits
Diffstat (limited to 'core')
-rw-r--r--core/models/caves.py31
1 files changed, 0 insertions, 31 deletions
diff --git a/core/models/caves.py b/core/models/caves.py
index 7bbe21b..b277041 100644
--- a/core/models/caves.py
+++ b/core/models/caves.py
@@ -407,30 +407,6 @@ class LogbookEntry(TroggleModel):
verbose_name_plural = "Logbook Entries"
# several PersonTrips point in to this object
ordering = ('-date',)
-
- # def __getattribute__(self, item):
- # if item == "cave":
- # #Allow a logbookentries cave to be directly accessed despite not having a proper foreignkey
- # return CaveSlug.objects.get(slug = self.cave_slug).cave
- # # parse error in python3.8
- # # https://stackoverflow.com/questions/41343263/provide-classcell-example-for-python-3-6-metaclass
- # #https://github.com/django/django/pull/7653
- # #return TroggleModel.__getattribute__(item)
- # #return super(LogbookEntry, self).__getattribute__(item) # works in py3.5, fails in 3.8
- # return TroggleModel.__getattribute__(self,item) # works in py 3.5 AND in 3.8
-
- # def __init__(self, *args, **kwargs):
- # if "cave" in list(kwargs.keys()):
- # if kwargs["cave"] is not None:
- # kwargs["cave_slug"] = CaveSlug.objects.get(cave=kwargs["cave"], primary=True).slug
- # kwargs.pop("cave")
- # # parse error in python3.8
- # return TroggleModel.__init__(self, *args, **kwargs) # seems OK in 3.5 & 3.8! failure later elsewhere with 3.8
- # #return TroggleModel().__init__(self, *args, **kwargs) # parses OK, fails at runtime in 3.8
- # #return super().__init__(self, *args, **kwargs) # fails in 3.8
- # #return super().__init__(*args, **kwargs) # works in py3.5 fails in 3.8
- # #return super(LogbookEntry, self).__init__(*args, **kwargs) # works in py3.5
- # #return TroggleModel.__init__(*args, **kwargs) # fails in py3.5, runtime fail in 3.8
def cave(self): # Why didn't he just make this a foreign key to Cave ? Replaces __getattrribute__ sillyness.
c = CaveSlug.objects.get(slug=self.cave_slug, primary=True).cave
@@ -540,13 +516,6 @@ class PersonTrip(TroggleModel):
def __str__(self):
return f'{self.personexpedition} ({self.logbook_entry.date})'
-# scansFileStorage = FileSystemStorage(location=settings.SURVEY_SCANS, base_url=settings.SURVEYS_URL)
-# def get_scan_path(instance, filename):
- # year=instance.survey.expedition.year
- # number=str(instance.survey.wallet_number)
- # if str(instance.survey.wallet_letter) != "None":
- # number=str(instance.survey.wallet_letter) + number #two strings formatting because convention is 2009#01 or 2009#X01
- # return os.path.join('./',year,year+r'#'+number,str(instance.contents)+str(instance.number_in_wallet)+r'.jpg')
Gcavelookup = None
Gcave_count = None