2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 10:37:07 +00:00

Edit caves in the same parent URL as the final file

This commit is contained in:
Martin Green
2022-07-31 17:08:28 +02:00
parent 91568b7151
commit 94252a94fe
4 changed files with 10 additions and 7 deletions

View File

@@ -145,6 +145,9 @@ class Cave(TroggleModel):
#return settings.URL_ROOT + '/cave/' + href + '/'
#return urljoin(settings.URL_ROOT, reverse('cave',kwargs={'cave_id':href,})) # WRONG. This produces /cave/161 and should be /1623/161
return Path(settings.URL_ROOT) / self.url # not good Django style.. NEEDS actual URL
def url_parent(self):
return self.url.rsplit("/", 1)[0]
def __str__(self, sep = ": "):
return str(self.slug())