MCPcopy
hub / github.com/django/django / get_absolute_url

Method get_absolute_url

django/contrib/flatpages/models.py:40–49  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

38 return "%s -- %s" % (self.url, self.title)
39
40 def get_absolute_url(self):
41 from .views import flatpage
42
43 for url in (self.url.lstrip("/"), self.url):
44 try:
45 return reverse(flatpage, kwargs={"url": url})
46 except NoReverseMatch:
47 pass
48 # Handle script prefix manually because we bypass reverse()
49 return iri_to_uri(get_script_prefix().rstrip("/") + self.url)

Callers 5

resolve_urlFunction · 0.45
locationMethod · 0.45
item_linkMethod · 0.45
get_success_urlMethod · 0.45

Calls 3

reverseFunction · 0.90
iri_to_uriFunction · 0.90
get_script_prefixFunction · 0.90