Change absolute url for caves to there expoweb url, such that links work

This commit is contained in:
Martin Green 2011-07-11 22:35:32 +01:00
parent 0183f94780
commit d3fb0352be

View File

@ -384,14 +384,15 @@ class Cave(TroggleModel):
return "%s-%s" % (self.kat_area(), self.unofficial_number)
def get_absolute_url(self):
if self.kataster_number:
href = self.kataster_number
elif self.unofficial_number:
href = self.unofficial_number
else:
href = official_name.lower()
#return settings.URL_ROOT + '/cave/' + href + '/'
return urlparse.urljoin(settings.URL_ROOT, reverse('cave',kwargs={'cave_id':href,}))
return urlparse.urljoin(settings.URL_ROOT, self.url)
#if self.kataster_number:
# href = self.kataster_number
#elif self.unofficial_number:
# href = self.unofficial_number
#else:
# href = official_name.lower()
##return settings.URL_ROOT + '/cave/' + href + '/'
#return urlparse.urljoin(settings.URL_ROOT, reverse('cave',kwargs={'cave_id':href,}))
def __unicode__(self):
if self.kataster_number: