From 7a220b4c877539ae4760632babf7f4ab34918180 Mon Sep 17 00:00:00 2001 From: Martin Green Date: Mon, 11 Jul 2011 22:35:32 +0100 Subject: [PATCH] Change absolute url for caves to there expoweb url, such that links work --- core/models.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/core/models.py b/core/models.py index 1c08a25..d199073 100644 --- a/core/models.py +++ b/core/models.py @@ -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: