forked from expo/troggle
remove commented out bits
This commit is contained in:
@@ -408,30 +408,6 @@ class LogbookEntry(TroggleModel):
|
|||||||
# several PersonTrips point in to this object
|
# several PersonTrips point in to this object
|
||||||
ordering = ('-date',)
|
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.
|
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
|
c = CaveSlug.objects.get(slug=self.cave_slug, primary=True).cave
|
||||||
return c
|
return c
|
||||||
@@ -540,13 +516,6 @@ class PersonTrip(TroggleModel):
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f'{self.personexpedition} ({self.logbook_entry.date})'
|
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
|
Gcavelookup = None
|
||||||
Gcave_count = None
|
Gcave_count = None
|
||||||
|
|||||||
Reference in New Issue
Block a user