MCPcopy
hub / github.com/django/django / get_context_data

Method get_context_data

django/contrib/admindocs/views.py:149–166  ·  view source on GitHub ↗
(self, **kwargs)

Source from the content-addressed store, hash-verified

147 template_name = "admin_doc/view_index.html"
148
149 def get_context_data(self, **kwargs):
150 views = []
151 url_resolver = get_resolver(get_urlconf())
152 try:
153 view_functions = extract_views_from_urlpatterns(url_resolver.url_patterns)
154 except ImproperlyConfigured:
155 view_functions = []
156 for func, regex, namespace, name in view_functions:
157 views.append(
158 {
159 "full_name": get_view_name(func),
160 "url": simplify_regex(regex),
161 "url_name": ":".join((namespace or []) + (name and [name] or [])),
162 "namespace": ":".join(namespace or []),
163 "name": name,
164 }
165 )
166 return super().get_context_data(**{**kwargs, "views": views})
167
168
169class ViewDetailView(BaseAdminDocsView):

Callers 8

get_context_dataMethod · 0.45
get_context_dataMethod · 0.45
get_context_dataMethod · 0.45
get_context_dataMethod · 0.45
get_context_dataMethod · 0.45
get_context_dataMethod · 0.45
get_context_dataMethod · 0.45
getMethod · 0.45

Calls 7

get_resolverFunction · 0.90
get_urlconfFunction · 0.90
get_view_nameFunction · 0.85
simplify_regexFunction · 0.85
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected