2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 08:41:51 +00:00

import syntax fix

This commit is contained in:
Philip Sargent 2020-06-02 21:38:01 +01:00
parent 90dc3dac3b
commit 4dd0a5ddf2

View File

@ -122,7 +122,7 @@ class Cave(TroggleModel):
else:
href = self.official_name.lower()
#return settings.URL_ROOT + '/cave/' + href + '/'
return urllib.parse.urljoin(settings.URL_ROOT, reverse('cave',kwargs={'cave_id':href,}))
return urljoin(settings.URL_ROOT, reverse('cave',kwargs={'cave_id':href,}))
def __str__(self, sep = ": "):
return str("slug:"+self.slug())
@ -387,7 +387,7 @@ class CaveDescription(TroggleModel):
return str(self.short_name)
def get_absolute_url(self):
return urllib.parse.urljoin(settings.URL_ROOT, reverse('cavedescription', args=(self.short_name,)))
return urljoin(settings.URL_ROOT, reverse('cavedescription', args=(self.short_name,)))
def save(self):
"""
@ -458,7 +458,7 @@ class LogbookEntry(TroggleModel):
return True
def get_absolute_url(self):
return urllib.parse.urljoin(settings.URL_ROOT, reverse('logbookentry',kwargs={'date':self.date,'slug':self.slug}))
return urljoin(settings.URL_ROOT, reverse('logbookentry',kwargs={'date':self.date,'slug':self.slug}))
def __str__(self):
return "%s: (%s)" % (self.date, self.title)
@ -518,7 +518,7 @@ class QM(TroggleModel):
def get_absolute_url(self):
#return settings.URL_ROOT + '/cave/' + self.found_by.cave.kataster_number + '/' + str(self.found_by.date.year) + '-' + '%02d' %self.number
return urllib.parse.urljoin(settings.URL_ROOT, reverse('qm',kwargs={'cave_id':self.found_by.cave.kataster_number,'year':self.found_by.date.year,'qm_id':self.number,'grade':self.grade}))
return urljoin(settings.URL_ROOT, reverse('qm',kwargs={'cave_id':self.found_by.cave.kataster_number,'year':self.found_by.date.year,'qm_id':self.number,'grade':self.grade}))
def get_next_by_id(self):
return QM.objects.get(id=self.id+1)